/* 
   GPS Tracker - Styling System
   Fully Integrated with Bootstrap 5
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-dark: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] {
    --bg-light: var(--bg-dark);
    --text-main: #f8fafc;
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    transition: background-color 0.3s ease;
}

/* --- BOOTSTRAP OVERRIDES --- */


.form-control,
.form-select {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- MONITOR PAGE --- */
#map {
    height: 100vh;
    width: 100vw;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 280px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
}

[data-bs-theme="dark"] .overlay,
[data-bs-theme="dark"] .sidebar {
    background-color: rgba(30, 41, 59, 0.85);
}

@media (min-width: 768px) {
    .overlay {
        top: 80px;
    }
}

.sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 300px;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
}

@media (max-width: 767px) {
    .sidebar {
        width: 100%;
        height: 40vh;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 24px 24px 0 0;
    }

    .overlay {
        display: none;
    }
}

.settings-icon {
    display: inline-block;
    transition: transform 0.3s ease, text-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
    /* Aplicamos color rojo al emoji usando filtros y sombras */
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1));
    text-shadow: 0 0 0 #ef4444;
    color: transparent !important;
}

.settings-icon:hover {
    transform: rotate(90deg) scale(1.1);
    opacity: 1;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 0 #ef4444;
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.pulse {
    animation: signal-pulse 1.5s infinite;
}

@keyframes signal-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Evitar solapamiento con controles de Leaflet */
.leaflet-right {
    margin-right: 330px !important;
    /* Ancho de sidebar (300px) + margen (20px) + extra (10px) */
    transition: margin-right 0.3s ease;
}

@media (max-width: 767px) {
    .leaflet-right {
        margin-right: 10px !important;
        margin-bottom: 42vh;
        /* Desplazar arriba cuando la sidebar está abajo en móviles */
    }
}

/* --- LOGIN & TRACK CARDS --- */
/* --- ANIMATIONS & EFFECTS --- */
.pulse-border {
    animation: border-pulse 2s infinite;
}

@keyframes border-pulse {
    0% {
        border-color: rgba(99, 102, 241, 0.2);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.1);
    }

    50% {
        border-color: rgba(99, 102, 241, 0.6);
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }

    100% {
        border-color: rgba(99, 102, 241, 0.2);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* --- UTILITIES --- */
.bg-primary-subtle {
    background-color: rgba(99, 102, 241, 0.1) !important;
}

/* .text-primary {
    color: var(--primary-color) !important;
} */

.extra-small {
    font-size: 0.75rem;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* --- ADMIN LOGIN PAGE --- */
.login-side {
    background-color: #ffffff;
    z-index: 10;
}

[data-bs-theme="dark"] .login-side {
    background-color: var(--card-dark);
}

.image-side {
    background: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)),
        url("../images/fondo_login_monitor.webp");
    background-size: cover;
    background-position: center;
    position: relative;
}

.image-overlay-text {
    position: absolute;
    bottom: 40px;
    left: 40px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* --- ADMIN PANEL --- */
.admin-page {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url("../images/fondo_admin.webp") no-repeat center center fixed;
    background-size: cover;
}

[data-bs-theme="dark"] .admin-page {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url("../images/fondo_admin.webp") no-repeat center center fixed;
    background-size: cover;
}

.admin-page h1,
.admin-page h2,
.admin-page h3 {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}


.admin-page h1 {
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .admin-page h1 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .btn-md-grow {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* --- FOOTER ELEMENTS --- */
.copyright-fixed {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    pointer-events: none;
}

.copyright-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 300;
}

.brand-logo-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.brand-logo-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.brand-logo-link:hover {
    transform: scale(1.05);
    opacity: 1;
}

.brand-logo-link img {
    height: 35px;
    width: auto;
}

@media (max-width: 767px) {
    .copyright-fixed {
        bottom: 15px;
        left: 15px;
        width: 60%;
    }

    .copyright-text {
        font-size: 10px;
    }

    .brand-logo-fixed {
        bottom: 15px;
        right: 15px;
    }

    .brand-logo-link img {
        height: 25px;
    }
}

/* --- SWEETALERT2 PREMIUM THEME --- */
.swal2-popup {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.swal2-title {
    color: #f8fafc !important;
}

.swal2-html-container {
    color: #cbd5e1 !important;
}

.swal2-confirm {
    border-radius: 12px !important;
    padding: 12px 30px !important;
}

.swal2-cancel {
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.swal2-success-circular-line-left,
.swal2-success-circular-line-right,
.swal2-success-fix {
    background-color: transparent !important;
}