/**
 * Premium Header Styles - Dollar2Day
 * Version: 3.0 Premium Edition
 */

/* ============================================
   1. MINI LIVE TICKER
   ============================================ */
.mini-ticker {
    background: linear-gradient(90deg, rgba(0, 34, 68, 0.95), rgba(0, 50, 100, 0.95));
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

body.dark-theme .mini-ticker {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 40, 0.95));
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.ticker-label {
    color: #FFD700;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticker-items {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
    animation: tickerFadeIn 0.5s ease;
}

.ticker-item:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.currency-icon {
    font-size: 16px;
}

.currency-name {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
}

.currency-price {
    color: #FFD700;
    font-weight: 700;
    font-size: 13px;
}

.currency-trend {
    font-size: 14px;
}

.currency-trend[data-trend="up"] {
    color: #4CAF50;
}

.currency-trend[data-trend="down"] {
    color: #f44336;
}

.currency-trend[data-trend="neutral"] {
    color: #999;
}

.currency-change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.currency-change[data-change^="+"] {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.currency-change[data-change^="-"] {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

@keyframes tickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   2. HEADER GLASSMORPHISM
   ============================================ */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header .container {
    max-width: 100%;
    padding: 0 30px;
}

body.dark-theme .site-header {
    background: rgba(0, 0, 0, 0.75);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.1);
}

/* Animated Gradient Border */
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #FFD700, #002244, #FFD700, #002244);
    background-size: 300% 100%;
    animation: gradientMove 4s linear infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* ============================================
   3. ENHANCED LOGO AREA
   ============================================ */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
    flex-wrap: nowrap;
}

@media (max-width: 1024px) {
    .main-nav ul {
        gap: 2px;
    }

    .main-nav a {
        padding: 8px 8px;
        font-size: 12px;
        gap: 4px;
    }

    .nav-icon {
        font-size: 15px;
    }

    .logo-text a {
        font-size: 20px;
    }
}

@media (max-width: 900px) {
    .main-nav a {
        padding: 6px 6px;
        font-size: 11px;
    }

    .nav-icon {
        display: none;
    }
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.03);
}

.logo-image {
    transition: all 0.3s ease;
}

.logo-image:hover {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.logo-image img {
    display: block;
    transition: transform 0.3s ease;
    width: 85px !important;
    height: 85px !important;
    object-fit: contain;
    aspect-ratio: 1 / 1;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text a {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.logo-text a:hover {
    color: #FFD700;
}

.tagline {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.8;
}

/* ============================================
   4. SMART NAVIGATION
   ============================================ */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    align-items: center;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.main-nav a:hover::before {
    width: 100%;
}

.main-nav a:hover .nav-icon {
    transform: scale(1.2);
}

.nav-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: rotate(180deg);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.theme-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:active {
    transform: rotate(360deg) scale(0.9);
}

/* ============================================
   5. MOBILE MENU
   ============================================ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 34, 68, 0.98), rgba(0, 50, 100, 0.98));
    backdrop-filter: blur(20px);
    z-index: 1200;
    padding: 60px 30px 30px;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .mobile-menu {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(20, 20, 40, 0.98));
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    color: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background: rgba(255, 215, 0, 0.4);
    transform: rotate(90deg);
}

.mobile-menu nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu nav a:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateX(-5px);
}

.mobile-menu .nav-icon {
    font-size: 28px;
}

/* ============================================
   6. RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .mini-ticker {
        padding: 6px 0;
    }

    .ticker-content {
        gap: 10px;
    }

    .ticker-items {
        gap: 10px;
    }

    .ticker-item {
        padding: 3px 8px;
        font-size: 11px;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo-text a {
        font-size: 18px;
    }

    .tagline {
        font-size: 10px;
    }

    .logo-image img {
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 480px) {
    .ticker-label {
        display: none;
    }

    .ticker-items {
        justify-content: center;
        width: 100%;
    }
}


/* ============================================
   PREMIUM DROPDOWN MENUS
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

body.light-theme .nav-dropdown-btn {
    color: #ffffff;
}

body:not(.light-theme) .nav-dropdown-btn {
    color: #ffffff;
}

.nav-dropdown-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu Container */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    padding: 12px;
    overflow: hidden;
}

body:not(.light-theme) .nav-dropdown-menu {
    background: rgba(20, 20, 40, 0.95);
    border-color: rgba(255, 215, 0, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Arrow pointer */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body:not(.light-theme) .nav-dropdown-menu::before {
    background: rgba(20, 20, 40, 0.95);
    border-left-color: rgba(255, 215, 0, 0.2);
    border-top-color: rgba(255, 215, 0, 0.2);
}

.nav-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 16px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

body:not(.light-theme) .dropdown-item {
    color: #ffffff;
}

body.light-theme .dropdown-item {
    color: #2c3e50;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    transition: width 0.3s ease;
    z-index: -1;
}

.dropdown-item:hover::before {
    width: 100%;
}

.dropdown-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

body.light-theme .dropdown-item:hover {
    background: rgba(0, 34, 68, 0.08);
    color: #002244;
}

body:not(.light-theme) .dropdown-item:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

.item-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.dropdown-item:hover .item-icon {
    transform: scale(1.15);
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    color: inherit;
}

.item-desc {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
    color: inherit;
}

/* CRITICAL FIX: Force dark text in light mode for all dropdown elements */
body.light-theme .nav-dropdown-menu .dropdown-item,
body.light-theme .nav-dropdown-menu .dropdown-item *,
body.light-theme .nav-dropdown-menu .dropdown-item span,
body.light-theme .nav-dropdown-menu .item-title,
body.light-theme .nav-dropdown-menu .item-desc {
    color: #2c3e50 !important;
}

body.light-theme .nav-dropdown-menu .dropdown-item:hover,
body.light-theme .nav-dropdown-menu .dropdown-item:hover *,
body.light-theme .nav-dropdown-menu .dropdown-item:hover span {
    color: #002244 !important;
}

/* Ensure dark mode keeps white text */
body:not(.light-theme) .nav-dropdown-menu .dropdown-item,
body:not(.light-theme) .nav-dropdown-menu .dropdown-item *,
body:not(.light-theme) .nav-dropdown-menu .dropdown-item span {
    color: #ffffff !important;
}

body:not(.light-theme) .nav-dropdown-menu .dropdown-item:hover,
body:not(.light-theme) .nav-dropdown-menu .dropdown-item:hover * {
    color: #FFD700 !important;
}


/* ============================================
   HORIZONTAL COUNTRY SELECTOR
   ============================================ */
.country-selector-container {
    position: relative;
}

.country-buttons {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 4px;
    overflow: hidden;
}

body:not(.light-theme) .country-buttons {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.4);
}

.country-buttons .country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.country-buttons .country-btn .flag {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.country-buttons .country-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.country-buttons .country-btn.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #002244;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

body:not(.light-theme) .country-buttons .country-btn.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000000;
}

/* Libya specific color */
.country-buttons .country-btn.active[href="/"] {
    background: linear-gradient(135deg, #003366, #004d99);
    color: #FFD700;
}

body.light-theme .country-buttons .country-btn.active[href="/"] {
    background: linear-gradient(135deg, #003366, #004d99);
    color: #FFD700;
}

/* Algeria specific color */
.country-buttons .country-btn.active[href*="algeria"] {
    background: linear-gradient(135deg, #006233, #009639);
    color: #ffffff;
}

body.light-theme .country-buttons .country-btn.active[href*="algeria"] {
    background: linear-gradient(135deg, #006233, #009639);
    color: #ffffff;
}

/* Old country selector - hide it */
.country-selector-nav {
    display: none;
}

.country-dropdown {
    display: none;
}

@media (max-width: 768px) {
    .country-selector-container {
        display: none;
    }

    .nav-dropdown {
        display: none;
    }
}

/* ============================================
   SECTION: BREADCRUMBS
   ============================================ */
.breadcrumbs {
    padding: 12px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: #FFD700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #ffffff;
}

body.light-theme .breadcrumbs {
    color: #5C6670;
}

body.light-theme .breadcrumbs a {
    color: #002244;
}

body.light-theme .breadcrumbs a:hover {
    color: #0056b3;
}