/**
 * Header & Footer Styles - Refined for Premium Look & Mobile UX
 */

/* ==========================================
   TOP BAR (الشريط العلوي)
   ========================================== */

.top-bar {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 0;
    font-size: 13px;
    font-family: var(--font-secondary);
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Fix for Top Bar Menu (if present) */
.top-bar-right ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.top-bar-right a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.top-bar-right a:hover {
    color: var(--color-primary);
}

/* Breaking News Ticker */
.orbit-ticker-wrapper {
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    height: 30px;
    max-width: 600px;
}

.ticker-title {
    background: var(--color-primary);
    color: white;
    padding: 3px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    white-space: nowrap;
}

.orbit-ticker-content {
    display: flex;
    gap: 30px;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
    align-items: center;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-item a {
    color: var(--color-text);
    font-weight: 600;
    font-size: 13px;
}

.ticker-item a:hover {
    color: var(--color-primary);
}

/* Dark Mode Toggle & Social */
.dark-mode-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--color-text-secondary);
}

.dark-mode-toggle:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* ==========================================
   MAIN HEADER
   ========================================== */

.site-header {
    background-color: var(--color-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1000;
}

/* Branding Area (Logo) - Middle Section */
.header-main {
    padding: 25px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Styling */
.site-branding {
    flex-grow: 1;
    text-align: center;
    /* Center Logo by default style */
}

.site-title {
    font-size: 32px;
    margin: 0;
    line-height: 1.2;
    font-weight: 800;
}

.site-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 5px;
}

.custom-logo {
    max-height: 80px;
    width: auto;
}

/* Navigation Bar (The black bar below logo) */
.main-navigation-wrapper {
    background-color: #1a1a1a;
    color: white;
    border-top: 4px solid var(--color-primary);
}

.main-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.orbit-menu {
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
    align-items: center;
}

.orbit-menu li {
    height: 100%;
    display: flex;
    align-items: center;
}

.orbit-menu li a {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    padding: 0 5px;
    transition: color 0.2s;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
}

.orbit-menu li a:hover,
.orbit-menu li.current-menu-item a {
    color: white;
    border-bottom-color: var(--color-primary);
}

/* Header Config Buttons (Search) */
.header-tools {
    display: flex;
    align-items: center;
}

.header-search-trigger {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 10px;
    transition: color 0.2s;
}

.header-search-trigger:hover {
    color: var(--color-primary);
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
    background-color: #1a1a1a;
    /* Dark Footer */
    color: #b0b0b0;
    padding: 60px 0 20px;
    margin-top: 60px;
    margin-bottom: 50px;
    /* Space for mobile nav */
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.footer-widget h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 50px;
    height: 1px;
    background-color: var(--color-primary);
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 10px;
}

.footer-widget li:last-child {
    border-bottom: none;
}

.footer-widget a {
    color: #a0a0a0;
    transition: color 0.2s;
}

.footer-widget a:hover {
    color: var(--color-primary);
    padding-right: 5px;
}

.footer-bottom {
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
}

/* ==========================================
   MOBILE BOTTOM NAV (Sticky)
   ========================================== */
.mobile-bottom-nav {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    padding: 10px 0;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Dark Mode Support for Bottom Nav */
body.dark-mode .mobile-bottom-nav {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Logic for Smart Scroll (JS will toggle this class) */
.mobile-bottom-nav.nav-hidden {
    transform: translateY(100%);
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
    transition: color 0.2s;
}

.mobile-bottom-nav .nav-item .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: var(--color-primary);
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */

@media (max-width: 992px) {
    .main-navigation-wrapper {
        display: none;
        /* Hide Menu on Mobile */
    }

    .header-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .site-branding {
        width: 100%;
        order: 1;
        margin-bottom: 10px;
    }

    .mobile-menu-toggle {
        display: flex !important;
        order: 2;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        right: -300px;
        /* Hidden */
        width: 300px;
        height: 100%;
        background: white;
        z-index: 9999;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-menu-overlay.active {
        right: 0;
    }

    .close-mobile-menu {
        background: none;
        border: none;
        font-size: 30px;
        position: absolute;
        top: 10px;
        left: 20px;
        cursor: pointer;
    }

    .mobile-menu-list li {
        border-bottom: 1px solid #eee;
    }

    .mobile-menu-list a {
        display: block;
        padding: 12px 0;
        color: var(--color-text);
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .top-bar-container {
        flex-direction: column;
        gap: 10px;
    }

    .top-bar-left,
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }

    .ticker-title {
        display: none;
        /* Simplify on mobile */
    }

    .mobile-bottom-nav {
        display: flex;
        /* Show Bottom Nav only on mobile */
    }

    /* Add padding to body so content isn't hidden behind nav */
    body {
        padding-bottom: 70px;
    }
}