/* Guardian Maps - Theme System */
/* Supports dark/light mode with CSS variables */

:root {
    /* Dark Theme (Default) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.05);
    --accent-primary: #06b6d4;
    --accent-secondary: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

[data-theme="light"] {
    /* Light Theme - Warm & Premium */
    --bg-primary: #f0f4f8;
    /* Slightly blue-tinted gray */
    --bg-secondary: #fefefe;
    /* Warm white */
    --bg-panel: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --text-primary: #1e293b;
    /* Slate-800 */
    --text-secondary: #475569;
    /* Slate-600 */
    --text-muted: #64748b;
    /* Slate-500 */
    --border-color: #e2e8f0;
    /* Slate-200 */

    /* Accents - Vibrant */
    --accent-primary: #0891b2;
    /* Cyan-600 */
    --accent-secondary: #2563eb;
    /* Blue-600 */

    /* Premium Shadows - More pronounced */
    --shadow-soft: 0 2px 8px -2px rgba(0, 0, 0, 0.08), 0 1px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Light mode overrides - refined */
[data-theme="light"] body {
    background: linear-gradient(180deg, #e0f2fe 0%, #f0f4f8 30%, #f8fafc 100%) !important;
    background-attachment: fixed !important;
}

[data-theme="light"] .glass-panel {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08),
        0 2px 8px -2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

/* Sidebar - light mode with subtle blue tint */
[data-theme="light"] aside,
[data-theme="light"] #sidebar,
[data-theme="light"] #sidebar-container {
    background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%) !important;
    border-right: 1px solid rgba(14, 165, 233, 0.1) !important;
    box-shadow: 4px 0 24px -4px rgba(14, 165, 233, 0.05) !important;
}

/* Card & Element Overrides - with subtle warmth */
[data-theme="light"] .bg-slate-950,
[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-900\/50,
[data-theme="light"] .bg-slate-900\/80,
[data-theme="light"] .bg-slate-900\/90,
[data-theme="light"] .bg-\[\#0c1222\],
[data-theme="light"] .bg-\[\#0f172a\] {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.06),
        0 2px 6px -2px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

/* Secondary Backgrounds */
[data-theme="light"] .bg-slate-800,
[data-theme="light"] .bg-slate-800\/50,
[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-white\/10 {
    background-color: #f8fafc !important;
    /* Slight contrast override */
    border: 1px solid #e2e8f0 !important;
}

/* Hover States */
[data-theme="light"] .hover\:bg-white\/10:hover,
[data-theme="light"] .hover\:bg-white\/5:hover {
    background-color: #f1f5f9 !important;
}

/* Text Colors */
[data-theme="light"] .text-white {
    color: #0f172a !important;
}

[data-theme="light"] .text-slate-200 {
    color: #334155 !important;
}

[data-theme="light"] .text-slate-300 {
    color: #475569 !important;
}

[data-theme="light"] .text-slate-400 {
    color: #64748b !important;
}

[data-theme="light"] .text-slate-500 {
    color: #94a3b8 !important;
}

/* Borders */
[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-slate-800,
[data-theme="light"] .border-slate-700 {
    border-color: #e2e8f0 !important;
}

/* Active sidebar item in light mode */
[data-theme="light"] .bg-cyan-500\/10 {
    background-color: #eff6ff !important;
    /* Blue-50 */
    border-color: #bfdbfe !important;
    /* Blue-200 */
    color: #0284c7 !important;
    /* Sky-600 */
}

/* Stats icons backgrounds */
[data-theme="light"] .bg-cyan-500\/20 {
    background-color: #ecfeff !important;
    color: #0891b2 !important;
}

[data-theme="light"] .bg-blue-500\/20 {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

[data-theme="light"] .bg-yellow-500\/20 {
    background-color: #fefce8 !important;
    color: #ca8a04 !important;
}

[data-theme="light"] .bg-purple-500\/20 {
    background-color: #faf5ff !important;
    color: #9333ea !important;
}

/* Mobile Menu - Premium Light */
[data-theme="light"] .mobile-menu-bg {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
}

[data-theme="light"] .mobile-header {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid #f1f5f9 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .mobile-text-primary {
    color: #0f172a !important;
}

[data-theme="light"] .mobile-text-muted {
    color: #64748b !important;
}

[data-theme="light"] .mobile-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: var(--shadow-soft) !important;
}

[data-theme="light"] .mobile-nav-link {
    color: #475569 !important;
}

[data-theme="light"] .mobile-nav-link:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

[data-theme="light"] .mobile-bar-bg {
    background: #e2e8f0 !important;
}

/* Global Modal - Light */
[data-theme="light"] #globalModal {
    background-color: rgba(248, 250, 252, 0.8) !important;
}

[data-theme="light"] #globalModal .bg-slate-900 {
    background-color: #ffffff !important;
    box-shadow: var(--shadow-medium) !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] #globalModal .text-slate-900 {
    color: #0f172a !important;
}

/* ============================================
   TOAST NOTIFICATION STYLES
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
    max-width: 400px;
    pointer-events: auto;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ============================================
   SKELETON LOADING STYLES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-panel) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 150px;
    border-radius: 16px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes scale-up {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scale-down {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fade-in 0.2s ease-out forwards;
}

.animate-fade-out {
    animation: fade-out 0.2s ease-in forwards;
}

.animate-scale-up {
    animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-scale-down {
    animation: scale-down 0.2s ease-in forwards;
}

/* ============================================
   MOBILE SIDEBAR TRANSITIONS
   ============================================ */

@media (max-width: 768px) {
    aside {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 50;
    }

    aside.open {
        transform: translateX(0);
    }

    #mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #mobile-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ============================================
   BETA BANNER
   ============================================ */

.beta-banner {
    background: rgba(6, 182, 212, 0.08);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
    backdrop-filter: blur(8px);
}

[data-theme="light"] .beta-banner {
    background: #ecfeff !important;
    border-bottom: 1px solid #cffafe !important;
}

.beta-text {
    color: rgba(34, 211, 238, 0.7);
}

[data-theme="light"] .beta-text {
    color: #0891b2 !important;
}

/* ============================================
   MOBILE MENU DEFAULT (DARK) CLASSES
   ============================================ */

.mobile-menu-bg {
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(10px);
}

.mobile-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-text-primary {
    color: #ffffff;
}

.mobile-text-muted {
    color: #94a3b8;
}

.mobile-nav-link {
    color: #cbd5e1;
    transition: background-color 0.2s;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-border-b {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-border-t {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-bar-bg {
    background: #1e293b;
}

/* Glass panel base */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}