/* ============================================================
   GIFEC SHARED NAVBAR STYLES
   Import this on every page:
   <link rel="stylesheet" href="navbar.css">
   ============================================================ */

/* ── NAVBAR BASE ─────────────────────────────────────────── */
/* Sticky must live on the element that sits directly in the
   body flow. #navbar-placeholder is that element — the inner
   .navbar is only as tall as its parent, so sticky on .navbar
   has no room to stick. */
#navbar-placeholder {
    position: sticky;
    top: 0;
    z-index: 100;
    display: block;
}

.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding:1px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav-item {
    margin: 0;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px 12px;
    color: #003f87;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.2s ease, border-bottom 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #0052cc;
    border-bottom: 3px solid #0052cc;
}

.nav-divider {
    color: #ddd;
    margin: 0 5px;
    user-select: none;
}

/* ── DROPDOWN ARROW ─────────────────────────────────────── */
.dropdown-arrow {
    font-size: 9px;
    display: inline-block;
    transition: transform 0.25s ease;
    margin-left: 2px;
    color: #003f87;
}

.nav-dropdown-item.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

/* ── DROPDOWN MENU ──────────────────────────────────────── */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background-color: #003f87;
    border-top: 3px solid #0052cc;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    z-index: 600;

    /* Smooth slide-down animation */
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Show dropdown when parent has .dropdown-open */
.nav-dropdown-item.dropdown-open .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ── DROPDOWN LINKS ─────────────────────────────────────── */
.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.3px;
    transition: background-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
    white-space: nowrap;
}

.dropdown-link i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.dropdown-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
    padding-left: 26px;
}

.dropdown-link:hover i {
    color: white;
}

/* Placeholder items slightly dimmed */
.dropdown-link.placeholder-link {
    opacity: 0.65;
    font-style: italic;
}

.dropdown-link.placeholder-link:hover {
    opacity: 1;
    font-style: normal;
}

/* Divider between dropdown items */
.dropdown-menu li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── HAMBURGER (mobile) ─────────────────────────────────── */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index:  999;
    padding: 0;
    margin-left: auto;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
    display: block;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 8px);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -8px);
}

/* ── RESPONSIVE — TABLET / MOBILE (≤ 768px) ─────────────── */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;   /* relative to .navbar, not the viewport */
        top: 64px;            /* always sits directly below the navbar */
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        align-items: flex-start;
        max-height: 0;
        overflow-y: hidden;
        overflow-x: visible;
        transition: max-height 0.35s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        z-index: 999;
    }

    .nav-menu.active {
        max-height: 600px;
        overflow-y: auto;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 14px 20px;
        border-bottom: 1px solid #eee;
        width: 100%;
        justify-content: space-between;
    }

    .nav-link:hover,
    .nav-link.active {
        border-bottom: 1px solid #eee;
        background-color: #f0f5ff;
    }

    .nav-divider {
        display: none;
    }

    /* Mobile dropdown — expands inline */
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        border-left: 3px solid #0052cc;
        margin-left: 20px;
        min-width: unset;
        width: calc(100% - 20px);
        background-color: #003f87;
        opacity: 1;
        transform: none;
        transition: none;
        padding: 4px 0;
    }

    .nav-dropdown-item.dropdown-open .dropdown-menu {
        display: block;
    }

    .dropdown-link {
        padding: 11px 16px;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
    }

    .dropdown-link:hover {
        padding-left: 22px;
    }

    .dropdown-menu li + li {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-arrow {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .nav-link {
        font-size: 12px;
        padding: 13px 16px;
    }

    .dropdown-link {
        font-size: 12px;
        padding: 10px 14px;
    }
}
