/* --- 0. CSS RESET --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* --- 1. SETTINGS & VARIABLES --- */
:root {
    --brand-yellow: #daa420; 
    --brand-yellow-dark: #c2931c; /* Darker yellow for hover states */
    --brand-yellow-light: #f5e6b8; /* Light yellow for backgrounds */
    --text-main: #222222;
    --text-light: #555555;
    --bg-white: #ffffff;
    --nav-height: 80px; /* Slightly shorter for professional look */
    --content-max-width: 1200px; /* Reduced from 1400px for better readability */
    --nav-max-width: 1200px; /* Consistent with content width */
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius: 4px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Base body styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px; /* Base font size for better readability */
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- 2. NAVBAR CONTAINER --- */
.navbar-area {
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: visible;
}

.navbar-container {
    max-width: var(--nav-max-width);
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 30px; /* Slightly reduced padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    overflow: visible;
    position: relative;
}

/* --- 3. LOGO --- */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 48px; /* Slightly smaller for better proportion */
    width: auto;
    transition: var(--transition);
}

.logo-text {
    margin-left: 12px;
    font-weight: 500;
    font-size: 18px;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

/* --- 4. NAVIGATION LINKS --- */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px; /* Slightly reduced for more compact look */
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding: 8px 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

/* Professional underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--brand-yellow);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- 5. DROPDOWN --- */
.has-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Invisible bridge area to maintain hover when moving from trigger to dropdown */
.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px; /* Increased to cover the full gap */
    background: transparent;
    z-index: 1000;
    pointer-events: auto;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px); /* Reduced gap from 8px to 5px for easier mouse movement */
    left: 0;
    background: var(--bg-white);
    min-width: 220px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 8px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
    z-index: 1001;
    white-space: nowrap;
    pointer-events: none;
    display: block;
    overflow: visible;
}

/* CSS hover fallback - will be overridden by JS on desktop but works as backup */
.has-dropdown:hover .dropdown-menu,
.has-dropdown .dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Triangle pointer for dropdown - matches container white color with visible border */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 20px;
    width: 0;
    height: 0;
    /* Outer triangle with subtle border color for visibility */
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(0, 0, 0, 0.05);
    z-index: 1001;
    pointer-events: none;
}

/* Inner white triangle that matches dropdown */
.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 21px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid var(--bg-white);
    z-index: 1002;
    pointer-events: none;
}

.dropdown-item {
    margin: 2px 0;
    border-radius: 6px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent !important;
}

/* Prevent any active state on the list item */
.dropdown-item:active {
    background-color: transparent !important;
}

.dropdown-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 6px;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
}

/* Hover effect - no golden border */
.dropdown-item a:hover {
    background: rgba(248, 249, 250, 1) !important;
    background-color: rgba(248, 249, 250, 1) !important;
    color: var(--brand-yellow-dark);
    transform: translateX(2px);
}

/* Active and focus states for dropdown items - prevent blue background flash */
.dropdown-item a:active,
.dropdown-item a:focus,
.dropdown-item a:focus-visible,
.dropdown-item a:visited:active {
    transform: translateX(1px);
    background: rgba(248, 249, 250, 1) !important;
    background-color: rgba(248, 249, 250, 1) !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: none !important;
    color: var(--brand-yellow-dark);
    transition: none !important;
}

/* Prevent any browser default active state */
.dropdown-item a::selection {
    background: transparent !important;
}

.dropdown-item a::-moz-selection {
    background: transparent !important;
}

/* Class to prevent flash - applied via JS */
.dropdown-item a.no-flash {
    background-color: rgba(248, 249, 250, 1) !important;
    transition: none !important;
}

/* --- 6. BUTTON (Professional Design with Yellow Theme) --- */
.btn-verify {
    padding: 9px 24px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    color: #ffffff;
    background-color: var(--brand-yellow);
    border: 1px solid var(--brand-yellow);
    border-radius: var(--border-radius);
    transition: var(--transition);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px; /* Slightly smaller */
    box-shadow: 0 2px 4px rgba(218, 164, 32, 0.2);
}

.btn-verify:hover {
    background-color: var(--brand-yellow-dark);
    border-color: var(--brand-yellow-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(218, 164, 32, 0.3);
    transform: translateY(-1px);
}

/* --- 7. MOBILE MENU --- */
.hamburger {
    display: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.bar {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* --- 8. RESPONSIVE DESIGN --- */
@media (max-width: 1100px) {
    .navbar-container {
        padding: 0 25px;
    }
    
    .nav-menu {
        gap: 22px;
    }
}

@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        right: 0;
        width: 300px;
        max-width: calc(100vw - 20px); /* Ensure it doesn't exceed viewport width with padding */
        height: calc(100vh - var(--nav-height));
        background: var(--bg-white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        transition: transform 0.4s ease-in-out;
        padding: 35px 25px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        overflow-x: hidden;
        gap: 0;
        z-index: 999;
        transform: translateX(100%);
    }

    .nav-menu.active {
        transform: translateX(0);
    }
    
    /* Ensure navbar container doesn't cause overflow */
    .navbar-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Dark overlay for mobile menu */
    .menu-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 998 !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }
    
    .menu-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-menu li {
        width: 100%;
        margin-bottom: 18px;
    }
    
    /* Ensure has-dropdown is full width and displays as block on mobile */
    .has-dropdown {
        width: 100%;
        display: block;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-link {
        padding: 10px 0;
        font-size: 15px;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .hamburger {
        display: flex;
    }

    /* Hide Desktop CTA in normal flow */
    .desktop-cta { display: none; }

    /* Show Mobile CTA in menu */
    .mobile-cta {
        display: block !important;
        margin-top: 25px;
        width: 100%;
        text-align: center;
    }

    /* Adjust Dropdown for Mobile - simple dropdown, no card style */
    .has-dropdown .dropdown-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        box-shadow: none;
        border: none;
        background: transparent;
        backdrop-filter: none;
        width: 100% !important;
        text-align: left;
        display: none;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        padding: 0;
        margin-top: 0;
        margin-left: 0 !important;
        margin-right: 0;
        border-radius: 0;
        min-width: auto;
        max-width: none;
        float: none;
    }
    
    .dropdown-menu::before,
    .dropdown-menu::after {
        display: none;
    }

    .dropdown-menu.active {
        display: block;
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .dropdown-item {
        margin: 0;
    }
    
    .dropdown-item a {
        padding: 10px 0;
        border-radius: 0;
        font-size: 15px;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }
    
    .dropdown-item a::before {
        display: none;
    }
    
    /* Remove hover background on mobile to prevent double highlight */
    .dropdown-item a:hover {
        background: transparent;
        transform: none;
        color: var(--text-main);
    }
    
    /* Also ensure nav-link hover doesn't conflict */
    .has-dropdown .nav-link:hover {
        background: transparent;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
            max-height: 0;
        }
        to {
            opacity: 1;
            transform: translateY(0);
            max-height: 200px;
        }
    }
    
    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-4px, 4px);
    }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-4px, -4px);
    }
    
    .logo-text {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        width: 280px;
    }
    
    .logo-text {
        display: none; /* Hide text on very small screens */
    }
}

/* Utility classes */
.mobile-cta { display: none; }

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

/* Active state for current page */
.nav-link.active {
    color: var(--text-main);
    font-weight: 500;
}

.nav-link.active::after {
    width: 100%;
}

