/* =========================================================================================================
    style.css — Shared Base Styles (Root Variables, Layout, Navigation, Utilities)
    Page-specific styles are in separate CSS files:
      auth.css         → Auth/Landing pages
      status.css       → Management Status page
      map.css          → Map page
      centers.css      → Manage Centers page
      assignments.css  → Volunteer Assignments page
      alerts.css       → Alerts page
      evacuees.css     → Evacuee Requests page
      admin.css        → Admin pages
      dashboard.css    → Evacuee/Volunteer dashboards
   ========================================================================================================= */

/* =========================================================================================================
    1. ROOT VARIABLES
   ========================================================================================================= */
:root {
    --primary-blue: #0066cc;
    --primary-hover: #0052a3;
    --dark-blue: #1a3c6d;
    --darker-blue: #112a4d;
    --success-green: #28a745;
    --success-bg: #e6ffed;
    --warning-yellow: #ffc107;
    --warning-bg: #fff3cd;
    --danger-red: #dc3545;
    --danger-bg: #ffebee;
    --info-cyan: #17a2b8;
    --theme-purple: #6200EA;
    --theme-purple-light: #e1bee7;
    --theme-purple-dark: #4a148c;
    --theme-green: #00C853;
    --theme-orange: #EF6C00;
    --theme-orange-hover: #E65100;
    --theme-orange-light: #FFE0B2;
    --theme-orange-bg: #FFF8E1;
    --chart-purple: #6f42c1;
    --chart-pink: #e83e8c;
    --chart-orange: #fd7e14;
    --chart-teal: #20c997;
    --bg-main: #1e5a99;
    --bg-dark: #1a202c;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-light-gray: #999999;
    --border-color: #e0e0e0;
    --input-bg: #f9fafb;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.text-green { color: var(--success-green); }
.text-blue  { color: var(--primary-blue); }
.text-muted { color: var(--text-muted); }
.mt-2       { margin-top: 1rem; }
.mt-4       { margin-top: 1.5rem; }
.hidden     { display: none !important; }
.flex       { display: flex !important; }


/* =========================================================================================================
    2. LAYOUT & NAVIGATION
   ========================================================================================================= */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    background: transparent;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 6px;
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Shared small logo image used in portal navbars */
.logo-img-sm {
    max-height: 25px;
}

.brand-text h1 {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1;
}

.brand-text span {
    font-size: 0.75rem;
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 30px;
    height: 100%;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    border-bottom: 3px solid transparent;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--white);
    border-bottom-color: var(--primary-blue);
}

.nav-logout a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.nav-logout a:hover { color: var(--white); }

.page-header-strip {
    background: var(--white);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-icon-box {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.header-text h2 {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.header-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.center-selector-wrapper {
    position: relative;
    margin-left: auto;
}

.center-selector {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.center-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 15px;
    border: 1px solid #eee;
}

.center-dropdown.show {
    display: block;
    animation: fadeIn 0.2s;
}

.dropdown-header {
    padding: 12px 15px;
    background: #f8f9fa;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid #eee;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover { background: #f8f9fa; }

.dropdown-item.active {
    background: #e7f1ff;
    border-left: 3px solid var(--primary-blue);
}

.dropdown-item.active i { color: var(--primary-blue); }

.dropdown-footer {
    padding: 12px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.center-dropdown .dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.center-dropdown .dropdown-item:hover { background-color: #f8f9fa; }

.manage-link {
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.map-controls,
.manage-header,
.section-header {
    background: var(--white);
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.manage-header h2,
.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 700;
}

.manage-header p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.icon-box-lg {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    margin-right: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================================================================
    SHARED MODAL BASE — must stay in style.css so ALL pages hide modals by default
   ========================================================================================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.modal.show { display: flex; }

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.admin-modal.show { display: flex; }

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 15px;
    }
    .modal-body {
        display: block !important;
        min-height: 150px;
    }
}


/* =========================================================================================================
    10. MEDIA QUERIES
   ========================================================================================================= */
.hamburger-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    padding: 10px;
}

.mobile-only-logout { display: none; }
.desktop-only       { display: block; }
.nav-links a span   { display: inline; }

@media (max-width: 992px) {
    .floor-layout-grid {
        gap: 15px;
        padding: 15px;
        justify-content: flex-start;
    }
    .tent-icon { font-size: 0.7rem; }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0 15px;
        position: relative;
    }

    .hamburger-menu { display: block; }
    .desktop-only   { display: none; }

    .mobile-only-logout {
        display: block;
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 10px;
    }

    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--dark-blue);
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        max-height: 500px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links a {
        width: 100%;
        height: auto;
        padding: 15px 25px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        font-size: 1rem;
        color: rgba(255,255,255,0.8);
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255,255,255,0.1);
        border-bottom-color: transparent;
    }

    .nav-brand .brand-text { display: none; }

    .page-header-strip,
    .map-controls,
    .manage-header,
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .center-selector {
        width: 100%;
        justify-content: center;
        margin: 0;
    }

    .map-controls button,
    .section-header button {
        width: 100%;
        justify-content: center;
    }
}


/* =========================================================================================================
    NAVBAR ADMIN OVERRIDE BUTTON
   ========================================================================================================= */
.admin-override-btn {
    margin-left: 20px;
    background: rgba(220,53,69,0.1);
    border: 1px solid rgba(220,53,69,0.3);
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.admin-override-btn:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 0 10px rgba(220,53,69,0.5);
}

.admin-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 15px;
}


/* =========================================================================================================
    UTILITY
   ========================================================================================================= */
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }


/* ==========================================================================
   MANAGEMENT DASHBOARD FOOTER
   ========================================================================== */
.dashboard-footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 15px 25px;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 30px;
    width: 100%;
}

.dashboard-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-footer .footer-text i {
    color: #0056b3;
    margin-right: 5px;
}

.dashboard-footer .footer-links {
    font-weight: 500;
    color: #adb5bd;
}

@media (max-width: 768px) {
    .dashboard-footer .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .dashboard-footer {
        padding: 20px 15px;
    }
}