/* Hasiri Platform: Global Theme & Night Mode Variable Hub (Vanilla Static CSS) */

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-ui: #e2e8f0;
    --brand-primary: #10b981;
    --brand-dark: #064e3b;
}

.dark {
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-ui: #334155;
}

body {
    background-color: var(--bg-page) !important;
    color: var(--text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Base Utility Overrides for Dark Mode */
.dark .bg-white, 
.dark .bg-light,
.dark .card,
.dark .offcanvas,
.dark .dropdown-menu {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-ui) !important;
}

.dark .text-dark,
.dark .navbar-brand,
.dark .nav-link:not(.active) {
    color: var(--text-main) !important;
}

.dark .text-muted,
.dark .text-secondary {
    color: var(--text-muted) !important;
}

.dark .border,
.dark .border-bottom,
.dark .border-top,
.dark .dropdown-divider {
    border-color: var(--border-ui) !important;
}

/* Premium Component Adjustments */
.dark .glass-card {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

/* --- 🔝 NAVBAR & MOBILE NAVIGATION --- */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

/* Mobile-First Dual Navigation System */
.mobile-utility-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1060;
}

.bottom-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    z-index: 1050;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.03);
}

.bottom-nav .nav-link {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-link.active {
    color: var(--brand-primary);
}

.bottom-nav .nav-link i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

/* --- 🌙 NIGHT MODE OVERRIDES (Mobile) --- */
.dark .mobile-utility-bar {
    background: rgba(15, 23, 42, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark .mobile-utility-bar .fw-bold.text-dark {
    color: #f1f5f9 !important;
}

.dark .bottom-nav {
    background: rgba(15, 23, 42, 0.98) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4) !important;
}

.dark footer.bg-dark {
    background: #0f172a !important; /* Deep Slate 900 */
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.dark .bottom-nav .nav-link {
    color: #94a3b8;
}

.dark .bottom-nav .nav-link.active {
    color: var(--brand-primary);
}

/* Fix Bootstrap/Tailwind '.collapse' collision */
.navbar-collapse.collapse {
    visibility: visible !important;
}

/* On mobile, ensure collapsed menu is display:none so it doesn't push the toggler icon */
@media (max-width: 991.98px) {
    .navbar-collapse.collapse:not(.show) {
        display: none !important;
    }
}


/* Navigation Polish */
.nav-link {
    transition: all 0.2s ease;
}

.dark .navbar-glass {
    background: rgba(15, 23, 42, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark .hover-bg-light:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Form Overrides */
.dark .form-control,
.dark .form-select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.dark .form-control:focus {
    background-color: #020617 !important;
}

/* Accessibility and Contrast Polish */
.dark .text-success,
.dark .fa-leaf,
.dark .fa-prescription {
    color: #34d399 !important;
}

.dark .badge.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

.dark .badge.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

.dark .alert-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

/* Scrollbar Polish */
.dark ::-webkit-scrollbar {
    width: 10px;
    background: #0f172a;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
    border: 2px solid #0f172a;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
