/* ============================================
   MODERN TOP BAR NAVIGATION - SHARED STYLES
   Clean, Professional, Transportable
   Used by: public_html and secure subdomain
   Updated: November 1, 2025
   ============================================ */

* {
    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 !important;
    text-decoration: none !important;
    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);
}

/* Upgrade Button (Secure Site Only) */
.topbar-nav a.upgrade-btn {
    background: #c12321;
    font-weight: 600;
}

.topbar-nav a.upgrade-btn:hover {
    background: #a01f1d;
}

/* 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;
}

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

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

.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;
}

/* Country Code Quick Input */
.country-quick-input {
    padding: 16px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.country-quick-input label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.country-code-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
}

.country-code-input {
    width: 60px;
    height: 38px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    border: 2px solid #00498f;
    border-radius: 8px;
    background: white;
    color: #00498f;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    outline: none;
}

.country-code-input:focus {
    border-color: #003870;
    box-shadow: 0 0 0 3px rgba(0, 73, 143, 0.1);
    transform: scale(1.05);
}

.country-code-input::placeholder {
    color: #ccc;
    font-weight: 500;
}

.country-code-go {
    padding: 8px 16px;
    height: 38px;
    background: linear-gradient(135deg, #00498f 0%, #003870 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.country-code-go:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 73, 143, 0.3);
}

.country-code-go:active {
    transform: translateY(0);
}

/* 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 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;
}

/* Mobile Responsive Styles */
@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;
    }
    
    /* Ensure country selector stays below mobile menu */
    .country-selector {
        position: relative;
        z-index: -1;
    }
    
    .topbar-nav.active {
        display: flex;
    }
    
    .topbar-nav li {
        width: 100%;
    }
    
    .topbar-nav a {
        color: #333 !important;
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .topbar-nav a:hover {
        background: #f8f9fa;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .country-selector {
        order: -1;
    }
    
    /* Fix dropdown positioning on mobile to prevent overflow */
    .country-dropdown {
        right: auto;
        left: 0;
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }
}
