
/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* =========================================================
   COMMON CARDS
========================================================= */

.card,
.stat-card,
.chart-card,
.activity-card,
.sessions-card,
.top-bar,
.login-card {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    transition: background 0.3s ease;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

.text-muted {
    color: var(--text-muted);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* =========================================================
   INPUTS
========================================================= */

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 460px;
    margin: auto;
}

.login-card {
    background: #fff;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e2a3a 0%, #0f1724 100%);
    padding: 32px 28px;
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.login-logo i {
    font-size: 36px;
    color: #3b82f6;
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-header p {
    color: #94a3b8;
    font-size: 14px;
}

.login-body {
    padding: 32px 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper i {
    color: #94a3b8;
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    padding: 14px;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.forgot-link {
    text-align: center;
    margin-top: 20px;
}

.forgot-link a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: #cbd5e1;
    font-size: 12px;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.demo-credentials {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}

.demo-credentials code {
    display: block;
    background: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    margin-bottom: 6px;
}

/* Modal Overlay (Reset & Logout Confirm) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.reset-modal, .confirm-modal {
    background: #fff;
    border-radius: 28px;
    max-width: 420px;
    width: 90%;
    padding: 28px;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .reset-modal,
.modal-overlay.active .confirm-modal {
    transform: scale(1);
}

.confirm-modal h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f1724;
    margin-bottom: 12px;
}

.confirm-modal p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 24px;
}

.btn-reset, .btn-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    margin-top: 12px;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2100;
    display: flex;
    align-items: center;
    gap: 10px;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}

.toast-message.show {
    visibility: visible;
    opacity: 1;
}

/* Dashboard Styles (with mobile sidebar toggle) */
.dashboard-wrapper {
    width: 100%;
}

.dashboard-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    padding: 24px;
    position: relative;
}

/* Desktop Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e2a3a 0%, #0f1724 100%);
    border-radius: 28px;
    padding: 28px 16px;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.2s;
}

/* Mobile Menu Button & Overlay */
.mobile-menu-btn {
    display: none;
    background: #1e2a3a;
    border: none;
    color: white;
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    margin-bottom: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s ease;
}

.sidebar-mobile-overlay.active {
    visibility: visible;
    opacity: 1;
}

.sidebar-mobile-inner {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 300px;
    height: 100%;
    background: linear-gradient(180deg, #1e2a3a 0%, #0f1724 100%);
    box-shadow: 4px 0 30px rgba(0,0,0,0.3);
    overflow-y: auto;
    padding: 28px 16px;
    color: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    z-index: 1001;
}

.sidebar-mobile-overlay.active .sidebar-mobile-inner {
    transform: translateX(0);
}

.close-sidebar-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar-desktop {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .dashboard-container {
        flex-direction: column;
        padding: 16px;
    }
    .stats-grid, .charts-row, .bottom-grid {
        grid-template-columns: 1fr;
    }
}

.logo {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    padding-left: 12px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i {
    background: none;
    color: #3b82f6;
    font-size: 26px;
}
.nav-section {
    margin-bottom: 24px;
}
.nav-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #5b6e8c;
    margin-bottom: 12px;
    padding-left: 12px;
}
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 14px;
    color: #b9c3d4;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-item i {
    width: 20px;
}
.nav-item.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}
.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.dropdown-menu {
    margin-left: 28px;
    padding-left: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    border-left: 1px solid rgba(255,255,255,0.1);
}
.dropdown-menu.open {
    max-height: 500px;
}
.sub-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    color: #b0bedb;
    font-size: 13px;
    cursor: pointer;
}
.sub-nav-item:hover {
    background: rgba(59,130,246,0.2);
    color: white;
}
.main-content {
    flex: 1;
}
.top-bar {
    background: #fff;
    border-radius: 24px;
    padding: 16px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-title {
    font-size: 22px;
    font-weight: 600;
    color: #0f1724;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 24px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 24px;
    padding: 20px 24px;
}
.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #0f1724;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.chart-card {
    background: #fff;
    border-radius: 24px;
    padding: 20px 24px;
}
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.activity-card, .sessions-card {
    background: #fff;
    border-radius: 24px;
    padding: 20px 24px;
}
.live-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fef2e8;
    padding: 12px 16px;
    border-radius: 16px;
    margin: 16px 0;
}
.live-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}
.rate-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0deg 184deg, #e2e8f0 184deg 360deg);
    margin: 16px auto;
}
.text-muted {
    color: #94a3b8;
    font-size: 12px;
}
.stat-change {
    color: #10b981;
    background: #e9f9f0;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}
.btn-logout {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: 0.2s;
}
.btn-logout:hover {
    background: rgba(239,68,68,0.2);
    border-color: #ef4444;
}
.icon-btn {
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}
.mini-chart {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}
.bar {
    flex: 1;
    border-radius: 6px;
    background: #e2e8f0;
}
.bar.fill-1 {
    height: 28px;
    background: #3b82f6;
}
.bar.fill-2 {
    height: 42px;
    background: #3b82f6;
}
.week-bar {
    width: 100%;
    border-radius: 8px;
}
.week-bar-wrapper {
    flex: 1;
    text-align: center;
    font-size: 11px;
}


/* Loading Screen Backdrop Layout */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Header & Spinner Element Style */
.loading-header {
    text-align: center;
    margin-bottom: 40px;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid #f97316; /* Vibrant African Orange accent */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

.loading-title {
    color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.loading-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Responsive Card Showcase Grid */
.food-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1100px;
}

@media (min-width: 768px) {
    .food-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Individual Card Styling */
.food-card {
    background-color: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: #334155;
}

.food-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.food-region {
    display: inline-block;
    color: #f97316;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.food-name {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.food-desc {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Hardware accelerated CSS Spin Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}




/* Full View Workspace Container */
.logout-page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f172a; /* Deep slate background matching the loader */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Layers on top of charts/loading grids */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 24px;
    box-sizing: border-box;
}

/* Elegant Interface Panel Card */
.logout-card-panel {
    background-color: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Brand Display Sub-Section */
.logout-brand-area {
    margin-bottom: 32px;
}

.logout-icon-shield {
    width: 64px;
    height: 64px;
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6; /* Secure blue accent */
    font-size: 1.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin: 0 auto 16px auto;
}

.logout-brand-title {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

/* Message Block Design */
.logout-message-body {
    margin-bottom: 32px;
}

.logout-prompt-heading {
    color: #f8fafc;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.logout-prompt-text {
    color: #94a3b8;
    font-size: 0.925rem;
    line-height: 1.6;
    margin: 0;
}

/* Action Control Items */
.logout-actions-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-logout-panel {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-logout-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-logout-danger:hover {
    background-color: #b91c1c;
}

.btn-logout-cancel {
    background-color: #334155;
    color: #f8fafc;
}

.btn-logout-cancel:hover {
    background-color: #475569;
}

/* Technical Footer Disclaimer */
.logout-footer-notice {
    color: #64748b;
    font-size: 0.775rem;
}

.logout-footer-notice i {
    margin-right: 4px;
}


/* Styling for Sidebar Nested Links */
.sub-menu-container {
    padding-left: 1.5rem;
    background-color: rgba(0, 0, 0, 0.02); /* Slight contrast background */
}

.sub-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

.sub-nav-item:hover {
    color: #212529;
}

/* Handle the arrow rotation automatically via Bootstrap states */
.dropdown-trigger .chevron {
    transition: transform 0.2s ease-in-out;
}

.dropdown-trigger[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}


/* ======================================= 
Table Image Preview  
==========================================*/
.table-img-preview-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa; /* Light grey placeholder background */
    border: 1px solid #dee2e6;  /* Subtle border */
    border-radius: 4px;        /* Smooth corners */
    overflow: hidden;          /* Crops overflowing image edges */
}

/* Image behavior inside container */
.table-img-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* Fills area without stretching */
    object-position: center;   /* Centers the image crop */
    transition: transform 0.2s ease-in-out;
}

/* Optional hover zoom effect */
.table-img-preview:hover {
    transform: scale(1.15);
    cursor: pointer;
}

