/* ============================================
   MODERN TOP BAR NAVIGATION
   Clean, Professional, Transportable
   ============================================ */

* {
    box-sizing: border-box;
}

/* Top Bar Container */
.topbar {
    background: linear-gradient(135deg, #00498f 0%, #003870 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
    width: 100%;
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

/* Main Navigation */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar-nav li {
    line-height: 1;
}

.topbar-nav a {
    color: white;
    text-decoration: none;
    padding: 18px 16px;
    display: block;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
}

.topbar-nav a:hover {
    background: rgba(255,255,255,0.15);
}

.topbar-nav a.active {
    background: rgba(255,255,255,0.2);
}

/* Right Section */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Country Selector */
.country-selector {
    position: relative;
}

.country-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    transition: background 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    height: 40px;
    box-sizing: border-box;
}

.country-trigger:hover {
    background: rgba(255,255,255,0.25);
}

.country-trigger img {
    width: 24px;
    height: 18px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 2px;
}

.country-trigger .arrow {
    color: white;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.country-trigger.active .arrow {
    transform: rotate(180deg);
}

.country-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 240px;
    max-height: 450px;
    overflow-y: auto;
    z-index: 1001;
    animation: dropdownFadeIn 0.2s ease;
}

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

.country-dropdown.active {
    display: block;
}

/* Country Code Quick Input */
.country-dropdown .country-quick-input {
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.country-dropdown .country-quick-input label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.country-dropdown .country-code-wrapper {
    display: flex;
    gap: 6px;
}

.country-dropdown .country-code-wrapper input.country-code-input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #00498f;
    border-radius: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    outline: none;
    width: auto;
    height: auto;
    margin: 0;
    box-shadow: none;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.country-dropdown .country-code-wrapper input.country-code-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 73, 143, 0.15);
}

.country-dropdown .country-code-wrapper button.country-code-go {
    padding: 6px 14px;
    background: #00498f;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    transition: background 0.2s ease;
}

.country-dropdown .country-code-wrapper button.country-code-go:hover {
    background: #003870;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item:hover {
    background: #f8f9fa;
    padding-left: 20px;
}

.country-item img {
    width: 24px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.country-item span {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* User Account Button */
.user-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    color: white !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    height: 40px;
    box-sizing: border-box;
    white-space: nowrap;
    min-width: fit-content;
}

.user-account * {
    pointer-events: none;
}

.user-account:hover,
.user-account:visited,
.user-account:active,
.user-account:focus {
    background: rgba(255,255,255,0.25);
    text-decoration: none !important;
    color: white !important;
    outline: none;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.2);
}

.user-account svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Mobile CTA Button */
.mobile-cta {
    display: none;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 3px 9px;
    border-radius: 6px;
    height: 40px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(255,255,255,0.25);
}

/* Mobile Menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 968px) {
    .topbar-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding: 10px 0;
        z-index: 1002;
    }
    
    .topbar-nav.active {
        display: flex;
    }
    
    .topbar-nav li {
        width: 100%;
    }
    
    .topbar-nav a {
        color: #333;
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .topbar-nav a:hover {
        background: #f8f9fa;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .mobile-cta {
        display: flex;
        align-items: center;
        gap: 6px;
        color: white;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        padding: 8px 12px;
        background: rgba(255,255,255,0.15);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 6px;
        height: 40px;
        box-sizing: border-box;
        transition: background 0.3s ease;
    }
    
    .mobile-cta:hover {
        background: rgba(255,255,255,0.25);
        text-decoration: none;
        color: white;
    }
    
    .mobile-cta svg {
        width: 18px;
        height: 18px;
        fill: white;
    }
    
    /* Ensure country selector stays below mobile menu */
    .country-selector {
        position: relative;
        z-index: -1;
    }
    
    .country-dropdown {
        right: auto;
        left: 0;
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .topbar-inner {
        padding: 0 15px;
        height: 55px;
    }
    
    .topbar-right {
        gap: 10px;
    }
    
    .country-trigger,
    .user-account {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Scrollbar Styling for Dropdown */
.country-dropdown::-webkit-scrollbar {
    width: 8px;
}

.country-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.country-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.country-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}
