/* ============================================================================
   MASTER CSS - NAVBAR, FOOTER, DROPDOWN ONLY
   All pages use this for navigation consistency
   ============================================================================ */

:root {
    --primary: #1a1a2e;
    --accent: #0284c7;
    --text: #1a1a2e;
}

body.high-contrast {
    --primary: #000000;
    --accent: #00ff00;
    --text: #ffffff;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */

header.navbar {
    background: var(--primary);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow-x: hidden;
    width: 100%;
    min-height: 56px;
    box-sizing: border-box;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 1000;
    overflow: visible;
    width: 100%;
    padding-right: 1.5rem;
    box-sizing: border-box;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    height: 40px;
    line-height: 40px;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand svg {
    width: 32px;
    height: 32px;
}

.navbar-nav {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex: 1;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    margin-left: auto;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-nav a,
.dropdown-toggle {
    color: white;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    padding-bottom: 0.35rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px;
    line-height: 40px;
    font-family: 'Poppins', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    border-bottom-color: var(--accent);
    color: white;
}

.dropdown-toggle:hover {
    border-bottom-color: var(--accent);
    color: white;
}

/* Dropdown menu styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
    height: 40px;
    line-height: 40px;
    z-index: 1001;
    overflow: visible;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    cursor: pointer;
}

.dropdown-menu {
    position: fixed;
    background: var(--primary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    min-width: 250px;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0;
    display: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    right: auto;
}

/* Show dropdown on hover */
.nav-dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Show dropdown on focus/active */
.nav-dropdown.active .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.dropdown-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    background: none;
    cursor: pointer;
}

.dropdown-menu a:hover {
    background: rgba(2, 132, 199, 0.2);
    border: none;
    padding-left: 1.2rem;
}

.contrast-toggle {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}

.contrast-toggle:hover {
    background: white;
    color: var(--primary);
}

body.high-contrast header.navbar {
    border-bottom: 3px solid var(--accent);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    background: var(--primary);
    color: white !important;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

footer p {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: white;
}

footer a {
    color: white !important;
    text-decoration: underline;
    margin: 0 0.5rem;
    font-size: 1rem;
}

footer a:hover {
    opacity: 0.8;
}

/* ============================================================================
   HIGH CONTRAST MODE
   ============================================================================ */

body.high-contrast header.navbar {
    background: var(--primary);
    border-bottom: 3px solid var(--accent);
}

body.high-contrast .navbar-brand {
    color: white !important;
}

body.high-contrast .navbar-nav a,
body.high-contrast .dropdown-toggle {
    color: white !important;
    border-bottom-color: transparent !important;
}

body.high-contrast .navbar-nav a:hover,
body.high-contrast .navbar-nav a.active,
body.high-contrast .dropdown-toggle:hover {
    border-bottom-color: var(--accent) !important;
    color: white !important;
}

body.high-contrast .dropdown-menu {
    background: var(--primary) !important;
    border: 2px solid var(--accent) !important;
}

body.high-contrast .dropdown-menu a {
    color: white !important;
    background: transparent !important;
}

body.high-contrast .dropdown-menu a:hover {
    background: rgba(0, 255, 0, 0.15) !important;
    color: white !important;
}

body.high-contrast .contrast-toggle {
    border-color: white !important;
    color: white !important;
}

body.high-contrast .contrast-toggle:hover {
    background: white !important;
    color: var(--primary) !important;
}

body.high-contrast footer {
    background: var(--primary);
    border-top: 2px solid var(--accent);
}

body.high-contrast footer a {
    color: var(--accent) !important;
    text-decoration: underline !important;
}

body.high-contrast footer p {
    color: white !important;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    header.navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-content {
        gap: 0.75rem;
        position: relative;
    }

    .navbar-brand {
        font-size: 0.9rem;
        gap: 0.35rem;
    }

    .navbar-brand svg {
        width: 28px;
        height: 28px;
    }

    .hamburger-menu {
        display: flex;
        order: 10;
    }

    .navbar-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--primary);
        flex-direction: column;
        gap: 0;
        display: none;
        padding: 0.5rem 0;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 999;
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-nav a,
    .dropdown-toggle {
        font-size: 1rem;
        height: auto;
        line-height: 1.4;
        padding: 0.85rem 1.25rem;
        border-width: 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        width: 100%;
        text-align: left;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        margin: 0;
        box-shadow: none;
        top: auto;
        min-width: 100%;
        border: none;
        border-left: 2px solid var(--accent);
        border-radius: 0;
        padding: 0;
    }

    .nav-dropdown.active .dropdown-menu {
        display: flex;
        flex-direction: column;
    }

    .dropdown-menu a {
        padding: 0.7rem 1rem 0.7rem 2rem;
        font-size: 0.95rem;
    }

    .contrast-toggle {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
        border-width: 1.5px;
        order: 11;
    }
}

@media (max-width: 480px) {
    header.navbar {
        padding: 0.5rem 0.75rem;
    }

    .navbar-content {
        gap: 0.4rem;
    }

    .navbar-brand {
        font-size: 0.8rem;
        gap: 0.25rem;
    }

    .navbar-brand svg {
        width: 24px;
        height: 24px;
    }

    .hamburger-menu {
        display: flex;
    }

    .hamburger-menu span {
        width: 22px;
        height: 2.5px;
    }

    .navbar-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--primary);
        flex-direction: column;
        gap: 0;
        display: none;
        padding: 0.5rem 0;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 999;
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-nav a,
    .dropdown-toggle {
        font-size: 0.95rem;
        height: auto;
        line-height: 1.4;
        padding: 0.85rem 1.25rem;
        border-width: 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        width: 100%;
        text-align: left;
    }

    .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        margin: 0;
        box-shadow: none;
        top: auto;
        min-width: 100%;
        border: none;
        border-left: 2px solid var(--accent);
        border-radius: 0;
        padding: 0;
    }

    .nav-dropdown.active .dropdown-menu {
        display: flex;
        flex-direction: column;
    }

    .dropdown-menu a {
        padding: 0.7rem 1rem 0.7rem 2rem;
        font-size: 0.9rem;
    }

    .contrast-toggle {
        font-size: 0.6rem;
        padding: 0.25rem 0.4rem;
        border-width: 1.5px;
        order: 11;
    }

    /* High Contrast - Mobile */
    body.high-contrast .navbar-nav a,
    body.high-contrast .dropdown-toggle {
        color: white !important;
        font-size: 0.75rem;
        border-bottom-color: transparent !important;
    }

    body.high-contrast .navbar-nav a:hover,
    body.high-contrast .navbar-nav a.active,
    body.high-contrast .dropdown-toggle:hover {
        border-bottom-color: var(--accent) !important;
    }

    body.high-contrast .dropdown-menu {
        border-width: 2px;
        min-width: 100%;
    }

    body.high-contrast .dropdown-menu a {
        font-size: 0.75rem;
        color: white !important;
    }
}
