:root {
    --primary: #002b40 !important;
    --primary-dark: #001a26 !important;
    --primary-light: #9ad4f1 !important;
}
body { font-family: "Inter", "Segoe UI", Roboto, sans-serif; }

/* Light Mode Defaults */
html:not(.dark) body { background-color: #f4f7f9 !important; color: #1e293b !important; }
html:not(.dark) .card, html:not(.dark) .panel { background: white !important; }
html:not(.dark) nav, html:not(.dark) .navbar { background: rgba(255, 255, 255, 0.95) !important; }
html:not(.dark) .nav-pills { background: #e2e8f0 !important; }
html:not(.dark) input[type="text"], html:not(.dark) input[type="search"], html:not(.dark) input[type="email"], html:not(.dark) input[type="password"] { 
    background-color: #ffffff !important; 
    border-color: #cbd5e1 !important; 
    color: #1e293b !important;
}

/* Dark Mode Overrides */
html.dark body { background-color: #0f172a !important; color: #f8fafc !important; }
html.dark .card, html.dark .panel { background: #1e293b !important; border-color: rgba(255,255,255,0.05) !important; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5) !important; }
html.dark nav, html.dark .navbar { background: rgba(30, 41, 59, 0.95) !important; box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important; }
html.dark .nav-pills { background: #0f172a !important; color: white !important; }
html.dark .nav-pills a:not(.active) { color: #cbd5e1 !important; }
html.dark input[type="text"], html.dark input[type="search"], html.dark input[type="email"], html.dark input[type="password"] { 
    background-color: #0f172a !important; 
    border-color: #334155 !important; 
    color: white !important; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2) !important;
}
html.dark .text-slate-800, html.dark .text-gray-800, html.dark .text-slate-900 { color: #f1f5f9 !important; }
html.dark .text-slate-600, html.dark .text-gray-600 { color: #cbd5e1 !important; }

/* Modern Buttons */
.btn, button, .button, a.btn-primary { 
    background: linear-gradient(135deg, var(--primary), #11435e) !important; 
    color: white !important; 
    border-radius: 50px !important; 
    font-weight: 500 !important; 
    letter-spacing: 0.2px !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important; 
    border: none !important; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important; 
}
.btn:hover, button:hover, a.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 16px rgba(0,0,0,0.25) !important; 
    filter: brightness(1.1); 
}

/* Outline Buttons overrides */
.btn-outline, .button-outline {
    background: transparent !important;
    color: var(--primary) !important;
    border: 2px solid var(--primary) !important;
    box-shadow: none !important;
}
html.dark .btn-outline, html.dark .button-outline {
    color: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
}
.btn-outline:hover, .button-outline:hover {
    background: rgba(0,43,64,0.05) !important;
    transform: translateY(-2px); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important; 
}
html.dark .btn-outline:hover, html.dark .button-outline:hover {
    background: rgba(154, 212, 241, 0.1) !important;
}

/* Fix Icon and Link Buttons */
.btn-icon, button.btn-icon, .btn-link, button.btn-link, button.btn-close, .close {
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    border: none !important;
}
.btn-icon:hover, button.btn-icon:hover, .btn-link:hover, button.btn-link:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    transform: none !important;
    box-shadow: none !important;
}
html.dark .btn-icon:hover, html.dark button.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Modern Cards structure */
.card, .panel { 
    border-radius: 16px !important; 
    box-shadow: 0 10px 25px -5px rgba(0,43,64,0.08) !important; 
    border: 1px solid rgba(0,43,64,0.03) !important; 
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    overflow: hidden;
}
.card:hover, .panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0,43,64,0.15) !important;
}
html.dark .card:hover, html.dark .panel:hover {
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.4) !important;
}

/* Fix Card Icons */
.room-icon, .card div[class*="bg-blue-"], .card div[class*="bg-primary"], .card div[class*="bg-indigo-"] {
    background: linear-gradient(135deg, #002b40 0%, #1a6085 100%) !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
}
.room-icon svg, .room-icon .text-brand {
    color: #ffffff !important;
}

/* Ensure Card Footer remains original */
.card .bg-slate-50, .card .bg-gray-50, .card .card-footer {
    background: inherit !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Search Bar focus */
input[type="text"], input[type="search"], input[type="email"], input[type="password"] {
    border-radius: 50px !important;
    transition: all 0.2s ease !important;
}
input:focus {
    box-shadow: 0 0 0 3px rgba(154, 212, 241, 0.4) !important;
    border-color: #9ad4f1 !important;
    outline: none !important;
}

/* Tabs Navigation */
.nav-pills { border-radius: 50px; display: inline-flex; }
a.bg-primary { border-radius: 50px !important; box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important; }

/* Navbar generic */
nav, .navbar { 
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important; 
    border-bottom: none !important;
    position: relative !important;
    z-index: 1030 !important;
}

/* Logo sizing in navbar */
nav .small-logo, .navbar .small-logo, nav img.cursor-pointer {
    max-height: 44px !important;
    max-width: 180px !important;
    width: auto !important;
    object-fit: contain !important;
}
html.dark nav .small-logo, html.dark .navbar .small-logo, html.dark nav img.cursor-pointer {
    background-color: white !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
}

/* Fix Dropdown z-index - must be above everything */
.dropdown-menu, .navbar .dropdown-menu, .nav-item .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Fix Navbar stacking context - backdrop-filter breaks z-index on children */
nav .container, nav .container-fluid {
    position: static !important;
}


/* Hide Greenlight Footer */
footer#footer, footer.footer, #footer, .footer {
    display: none !important;
}
