/**
 * Layout Styles - Header, Navigation, Breaking News
 */

/* ==================== SITE HEADER ==================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

/* ==================== TOP BAR (ALWAYS DARK) ==================== */

.header-top-bar {
    background-color: #1a1a1a;
    padding: 10px 0;
    width: 100%;
}

.header-top-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 28px;
    width: auto;
    display: block;
}

/* Date & Time */
.header-datetime {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-right: auto;
}

.header-datetime .time {
    font-weight: 600;
}

/* Right Actions (DESKTOP) */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Watch Button (Orange with play icon) */
.btn-watch {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #FF5722;
    color: white;
    padding: 6px 20px;
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-watch:hover {
    background-color: #e04400;
    color: white;
}

.btn-watch svg {
    width: 14px;
    height: 14px;
}

/* Language Dropdown */
.language-dropdown-wrapper {
    position: relative;
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 8px;
    transition: color 0.2s;
}

.language-dropdown-toggle:hover {
    color: #FF5722;
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: #2c2c2c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.language-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    background-color: #2c2c2c;
    transition: background-color 0.2s;
}

.language-dropdown-menu a:hover {
    background-color: #3a3a3a;
    color: #FF5722;
}

/* Theme Toggle */
.theme-toggle {
    padding: 6px;
    color: white;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: #FF5722;
}

.theme-toggle svg {
    display: block;
}

/* Show/hide icons based on theme */
.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

/* When dark theme is active */
.theme-dark .theme-toggle .icon-sun {
    display: none;
}

.theme-dark .theme-toggle .icon-moon {
    display: block;
}

/* Mobile Actions (HIDDEN ON DESKTOP) */
.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 12px;
}

.mobile-search-btn {
    padding: 6px;
    color: white;
    transition: color 0.2s;
}

.mobile-search-btn:hover {
    color: #FF5722;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: white;
    transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==================== NAVIGATION BAR (DESKTOP) ==================== */

.header-nav-bar {
    background-color: #E3E1E4;
    width: 100%;
    padding-top: 5px;
}

.header-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Navigation Menu */
.main-nav {
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: block;
    padding: 6px 12px;
    color: #1a1a1a;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.35px;
    white-space: nowrap;
    transition: all 0.2s;
    background-color: transparent;
}

.nav-link:hover {
    color: #FF5722;
    background-color: rgba(255, 87, 34, 0.05);
}

.nav-link.active {
    color: white;
    background-color: #18191E;
}

/* Search Icon Button */
.search-icon-btn {
    padding: 6px 12px;
    color: #1a1a1a;
    transition: color 0.2s;
}

.search-icon-btn:hover {
    color: #FF5722;
}

/* ==================== SEARCH BAR DROPDOWN (DESKTOP) ==================== */

.search-bar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    z-index: 999;
    width: 100%;
}

.search-bar-dropdown.active {
    max-height: 100px;
    padding: 5px 0;
}

.search-bar-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar-input-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
}

.search-bar-input {
    flex: 1;
    padding: 12px 20px;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 14px;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

.search-bar-input:focus {
    outline: none;
    border-color: #FF5722;
}

.search-bar-input::placeholder {
    color: #999;
}

.search-bar-submit {
    padding: 12px 32px;
    background-color: #FF5722;
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.search-bar-submit:hover {
    background-color: #e04400;
}

.search-bar-close {
    padding: 8px;
    color: #666;
    transition: color 0.2s;
}

.search-bar-close:hover {
    color: #FF5722;
}

/* ==================== MOBILE MENU OVERLAY ==================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a1a;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: background-color 0.2s;
    z-index: 10;
}

.mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-content {
    padding: 80px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Mobile Search Bar */
.mobile-search-bar {
    width: 100%;
}

.mobile-search-form {
    display: flex;
    gap: 8px;
}

.mobile-search-input {
    flex: 1;
    padding: 12px 16px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
}

.mobile-search-input::placeholder {
    color: #999;
}

.mobile-search-input:focus {
    outline: none;
    border-color: #FF5722;
}

.mobile-search-submit {
    padding: 12px 16px;
    background-color: #FF5722;
    border-radius: 4px;
    color: white;
    transition: background-color 0.2s;
}

.mobile-search-submit:hover {
    background-color: #e04400;
}

/* Mobile Navigation */
.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-link {
    display: block;
    padding: 16px 0;
    color: white;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #333;
    transition: color 0.2s;
}

.mobile-nav-link:hover {
    color: #FF5722;
}

/* Mobile Actions */
.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.mobile-action-group {
    display: flex;
    gap: 12px;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #2c2c2c;
    color: white;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s;
    flex: 1;
}

.mobile-action-btn:hover {
    background-color: #3a3a3a;
}

.mobile-action-btn svg {
    width: 18px;
    height: 18px;
}

/* ==================== SCROLL TO TOP ==================== */

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FF5722;
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
    cursor: pointer;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: #e04400;
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* ==================== SHOW/HIDE HELPERS ==================== */

.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {

    /* Hide desktop elements */
    .header-datetime {
        display: none;
    }

    .desktop-only {
        display: none !important;
    }

    .desktop-nav {
        display: none;
    }

    .search-bar-dropdown {
        display: none;
    }

    /* Show mobile elements */
    .mobile-only {
        display: flex !important;
    }

    .header-mobile-actions {
        display: flex;
    }

    /* Adjust header spacing */
    .header-top-wrapper {
        gap: 12px;
        justify-content: space-between;
    }

    .header-logo img {
        height: 24px;
    }

    /* Scroll to top mobile */
    .scroll-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        bottom: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}