/**
 * E-Manşet Header Styles
 * Professional, responsive header component
 *
 * Structure:
 * 1. CSS Variables
 * 2. Accessibility
 * 3. Breaking News Ticker
 * 4. Top Bar
 * 5. Main Header & Navigation
 * 6. Mobile Styles
 * 7. Animations
 */

/* ============================================
   1. CSS VARIABLES
============================================ */
:root {
    /* Colors */
    --header-primary-dark: #191c4f;
    --header-primary-green: #2ecc71;
    --header-accent-red: #E3000F;
    --header-text-dark: #1a1a1a;
    --header-text-light: #666666;
    --header-text-muted: #999999;
    --header-white: #ffffff;
    --header-border: #e5e5e5;
    --header-bg-light: #f8f8f8;

    /* Spacing */
    --header-height: 56px;
    --header-gap-xs: 4px;
    --header-gap-sm: 8px;
    --header-gap-md: 16px;
    --header-gap-lg: 24px;

    /* Typography */
    --header-font: 'Metropolis', -apple-system, BlinkMacSystemFont, sans-serif;
    --header-fs-xs: 12px;
    --header-fs-sm: 13px;
    --header-fs-base: 14px;
    --header-fs-md: 15px;
    --header-fs-lg: 16px;
}

/* ============================================
   2. ACCESSIBILITY
============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--header-primary-dark);
    color: var(--header-white);
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--header-primary-green);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   3. BREAKING NEWS TICKER
============================================ */
.ticker-band {
    background: var(--header-accent-red);
    padding: 0;
    position: relative;
    z-index: 100;
}

.ticker-band-inner {
    display: flex;
    align-items: stretch;
    max-width: var(--container-max, 1400px);
    margin: 0 auto;
}

.ticker-label {
    background: var(--header-accent-red);
    padding: 10px 20px;
    font-size: var(--header-fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--header-white);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.ticker-label::after {
    content: '';
    position: absolute;
    right: -30px;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, var(--header-accent-red) 0%, transparent 100%);
    pointer-events: none;
}

.ticker-label-text {
    color: var(--header-white);
    font-weight: 800;
    display: flex;
    gap: 4px;
}

/* REC Recording Effect Dot */
.ticker-dot {
    width: 10px;
    height: 10px;
    background: var(--header-white);
    border-radius: 50%;
    animation: ticker-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes ticker-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 8px 4px rgba(255, 255, 255, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--header-accent-red);
}

.ticker-wrapper::before,
.ticker-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.ticker-wrapper::before {
    left: 0;
    background: linear-gradient(90deg, var(--header-accent-red) 0%, transparent 100%);
}

.ticker-wrapper::after {
    right: 0;
    background: linear-gradient(90deg, transparent 0%, var(--header-accent-red) 100%);
}

.ticker-track {
    display: flex;
    animation: ticker-scroll 50s linear infinite;
    will-change: transform;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    white-space: nowrap;
    color: var(--header-white);
    font-size: var(--header-fs-base);
    font-weight: 500;
}

.ticker-item::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--header-white);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.6;
}

.ticker-item a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.ticker-item a:hover {
    opacity: 0.8;
}

.ticker-time {
    font-size: var(--header-fs-xs);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* ============================================
   4. TOP BAR
============================================ */
.top-bar {
    background: var(--header-white);
    padding: 0;
    border-bottom: 1px solid var(--header-border);
    position: relative;
    z-index: 99;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max, 1400px);
    margin: 0 auto;
    padding: 0 var(--header-gap-md);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 8px 0;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

/* Finance Ticker */
.finance-ticker {
    display: flex;
    align-items: stretch;
    flex: 1;
    justify-content: center;
    padding: 0 var(--header-gap-lg);
}

.finance-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-right: 1px solid var(--header-border);
    transition: background 0.2s ease;
}

.finance-item:last-child {
    border-right: none;
}

.finance-item:hover {
    background: var(--header-bg-light);
}

.finance-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.finance-label {
    font-size: var(--header-fs-sm);
    font-weight: 700;
    color: var(--header-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.finance-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finance-value {
    font-size: var(--header-fs-md);
    font-weight: 700;
    color: var(--header-text-dark);
    line-height: 1.2;
}

.finance-change {
    font-size: var(--header-fs-xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.finance-change.up {
    color: var(--header-primary-green);
    background: rgba(46, 204, 113, 0.1);
}

.finance-change.down {
    color: var(--header-accent-red);
    background: rgba(227, 0, 15, 0.1);
}

.finance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.finance-icon svg {
    width: 16px;
    height: 16px;
}

.finance-icon.up svg {
    fill: var(--header-primary-green);
}

.finance-icon.down svg {
    fill: var(--header-accent-red);
}

/* Top Right Widgets */
.top-right {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    height: 60px;
}

/* Weather Widget */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    color: var(--header-text-dark);
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    border-left: 1px solid var(--header-border);
    font-family: inherit;
    transition: background 0.2s ease;
}

.weather-widget:hover {
    background: var(--header-bg-light);
}

.weather-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sun-icon svg {
    width: 40px;
    height: 40px;
}

.sun-center {
    fill: #f1c40f;
}

.sun-rays {
    fill: none;
    stroke: #f1c40f;
    stroke-width: 2;
    stroke-linecap: round;
    transform-origin: center;
    animation: sun-rotate 12s linear infinite;
}

@keyframes sun-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.weather-city {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--header-fs-sm);
    font-weight: 700;
    color: var(--header-text-dark);
}

.weather-city svg {
    width: 12px;
    height: 12px;
    stroke: var(--header-text-dark);
    transition: transform 0.2s ease;
}

.weather-widget[aria-expanded="true"] .weather-city svg {
    transform: rotate(180deg);
}

.weather-temp {
    font-size: var(--header-fs-xs);
    font-weight: 500;
    color: var(--header-text-light);
}

/* City Dropdown */
.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-white);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 200px;
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 0;
}

.city-dropdown[hidden] {
    display: none;
}

.city-option {
    padding: 12px 16px;
    font-size: var(--header-fs-sm);
    font-weight: 500;
    color: var(--header-text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--header-border);
}

.city-option:last-child {
    border-bottom: none;
}

.city-option:hover,
.city-option:focus {
    background: var(--header-bg-light);
    outline: none;
}

.city-option.selected {
    background: var(--header-primary-green);
    color: var(--header-white);
}

/* Clock Widget */
.clock-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--header-bg-light);
    border-left: 1px solid var(--header-border);
    padding: 0 16px;
    font-size: var(--header-fs-md);
    font-weight: 600;
    color: var(--header-text-dark);
    min-width: 90px;
    font-variant-numeric: tabular-nums;
}

.clock-widget svg {
    width: 18px;
    height: 18px;
    stroke: var(--header-text-muted);
    flex-shrink: 0;
}

/* Imsak Widget Link */
.imsak-widget-link {
    text-decoration: none;
    color: inherit;
    display: flex;
}

.imsak-widget-link:hover .imsak-widget {
    background: var(--header-bg-hover, rgba(0,0,0,0.05));
}

/* Imsak Widget */
.imsak-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: var(--header-bg-light);
    border-left: 1px solid var(--header-border);
}

.imsak-label {
    font-size: var(--header-fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--header-text-muted);
    line-height: 1;
}

.imsak-time {
    font-size: var(--header-fs-sm);
    font-weight: 700;
    color: var(--header-text-dark);
    line-height: 1.4;
}

/* Mobile Top Bar Buttons */
.mobile-topbar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--header-text-dark);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-topbar-btn:hover {
    background: var(--header-bg-light);
}

.mobile-topbar-btn svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   5. MAIN HEADER & NAVIGATION
============================================ */
.main-header {
    background: var(--header-white);
    padding: 0;
    border-bottom: 1px solid var(--header-border);
    position: relative;
    z-index: 98;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    /* max-width: var(--container-max, 1400px);
    margin: 0 auto;
    padding: 0 var(--header-gap-md); */
}

/* Navigation */
.main-nav {
    display: flex;
}

.nav-left {
    flex: 1;
    justify-content: flex-start;
}

.nav-right {
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 10px;
    color: var(--header-text-dark);
    font-size: var(--header-fs-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.nav-menu a:hover {
    color: var(--header-accent-red);
    border-bottom-color: var(--header-accent-red);
}

.nav-menu a:focus {
    outline: none;
}

/* Gallery Navigation Items */
.nav-gallery {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 0 8px;
}

.nav-gallery li {
    display: flex;
    align-items: center;
}

.nav-gallery-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px !important;
    height: auto !important;
    border: none !important;
    border-radius: 10px;
    color: #ffffff !important;
}

.nav-gallery-item:hover {
    opacity: 0.85;
}

.nav-gallery-item svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
}

.nav-gallery-item span {
    font-weight: 700;
    font-size: var(--header-fs-sm);
    color: #ffffff;
}

/* Foto Galeri */
.nav-gallery li:first-child .nav-gallery-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Video Galeri */
.nav-gallery li:last-child .nav-gallery-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0;
    /* border-left: 1px solid var(--header-border); */
}

/* Search Button */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid #e5e5e5 !important;
    border-radius: 10px;
    background: transparent;
    color: var(--header-text-dark);
    cursor: pointer;
    outline: none !important;
}

.search-btn:hover {
    border-color: #1a1a1a !important;
    background: #f8f8f8;
}

.search-btn:focus,
.search-btn:active {
    outline: none !important;
    border-color: #e5e5e5 !important;
}

.search-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* ============================================
   6. MOBILE STYLES
============================================ */
@media (max-width: 1200px) {
    .nav-menu a {
        padding: 0 12px;
        font-size: var(--header-fs-xs);
    }

    .nav-gallery-item {
        padding: 8px 14px !important;
    }

    .nav-gallery-item svg {
        width: 16px;
        height: 16px;
    }

    .nav-gallery-item span {
        font-size: 11px;
    }

    .search-btn {
        width: 40px;
        height: 40px;
    }
}

/* Disable hover scale effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .nav-gallery-item svg,
    .action-btn svg,
    .finance-icon svg {
        transform: none !important;
    }

    .nav-gallery-item:hover::before {
        opacity: 0;
    }

    .nav-gallery-item:active::before {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    /* Hide some finance items */
    .finance-item:nth-child(n+3) {
        display: none;
    }

    .finance-ticker {
        padding: 0 var(--header-gap-md);
    }

    /* Hide imsak widget */
    .imsak-widget {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Ticker - Fixed */
    .ticker-band {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .ticker-label {
        padding: 8px 12px;
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }

    .ticker-label-text {
        flex-direction: column;
        gap: 0;
        line-height: 1.1;
        font-size: var(--header-fs-xs);
    }

    .ticker-dot {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
    }

    .ticker-item {
        font-size: var(--header-fs-xs);
        padding: 8px 16px;
        white-space: normal;
        min-width: 230px;
        max-width: 280px;
    }

    .ticker-item a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ticker-track {
        animation-duration: 30s;
    }

    /* Top Bar - Fixed (ticker altında) */
    .top-bar {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 999;
    }

    /* Body padding for fixed headers */
    body {
        padding-top: 110px;
    }

    .logo-img {
        height: 36px;
    }

    .finance-ticker {
        display: none;
    }

    .top-right {
        display: flex;
        height: auto;
    }

    /* Mobile weather widget - compact */
    .weather-widget {
        padding: 0 8px;
        gap: 6px;
        border-left: none;
    }

    .weather-icon {
        width: 24px;
        height: 24px;
    }

    .weather-icon img {
        width: 24px;
        height: 24px;
    }

    .weather-info {
        flex-direction: row;
        gap: 4px;
        align-items: center;
    }

    .weather-city {
        font-size: 11px;
    }

    .weather-temp {
        font-size: 11px;
    }

    /* Hide clock and imsak on mobile */
    .clock-widget,
    .imsak-widget,
    .imsak-widget-link {
        display: none;
    }

    .mobile-topbar-btn {
        display: flex;
    }

    /* Main Header */
    .main-header {
        display: none;
    }
}

@media (max-width: 480px) {
    .ticker-label {
        padding: 6px 10px;
    }

    .ticker-item {
        font-size: 11px;
        padding: 6px 12px;
    }

    .logo-img {
        height: 32px;
    }

    .mobile-topbar-btn {
        width: 40px;
        height: 40px;
    }

    .mobile-topbar-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   7. ANIMATIONS & EFFECTS
============================================ */
/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
    .ticker-track {
        animation: ticker-scroll 50s linear infinite;
    }

    .sun-rays {
        animation: sun-rotate 12s linear infinite;
    }

    .ticker-dot {
        animation: ticker-pulse 1.2s ease-in-out infinite;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ticker-track {
        animation: none;
    }

    .sun-rays {
        animation: none;
    }

    .ticker-dot {
        animation: none;
        opacity: 1;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .nav-menu a {
        border-bottom-width: 4px;
    }

    .finance-change {
        border: 1px solid currentColor;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Print styles */
@media print {
    .ticker-band,
    .top-bar,
    .main-header {
        display: none !important;
    }
}

/* ============================================
   8. HOT NEWS OVERRIDES
============================================ */
.hot-news-image {
    overflow: inherit;
    margin-bottom: 20px;
    background-size: cover;
}

.hot-news-badge {
    bottom: -14px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}
