// ==========================================================================
// PressZone Theme - Header Styles
// ==========================================================================
// Uses Sass variables with body.dark-mode & nesting pattern.
// No CSS custom properties - pure compile-time variables.
// ==========================================================================

@import 'abstracts/variables';
@import 'abstracts/mixins';

// --------------------------------------------------------------------------
// Header Wrapper
// --------------------------------------------------------------------------
.header-wrapper {
    position: sticky;
    top: 0;
    z-index: $z-index-fixed;
}

// --------------------------------------------------------------------------
// Main Header
// --------------------------------------------------------------------------
.site-header {
    background: $light-header-bg;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid $light-border-color;
    padding: 1rem 0;
    transition: all $transition-base;

    body.dark-mode & {
        background: $dark-header-bg;
        border-bottom-color: $dark-border-color;
    }

    // Scrolled state
    &.header-scrolled {
        background: $light-header-scrolled-bg;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: $shadow-sm;

        body.dark-mode & {
            background: $dark-header-scrolled-bg;
        }
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    @include rtl {
        flex-direction: row-reverse;
    }
}

// --------------------------------------------------------------------------
// Logo
// --------------------------------------------------------------------------
.site-branding {
    flex-shrink: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;

    @include rtl {
        flex-direction: row-reverse;
    }
}

.logo-icon {
    font-size: 1.75rem;
    color: $color-primary;
    line-height: 1;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 900;
    color: $light-text-primary;
    letter-spacing: -0.025em;

    body.dark-mode & {
        color: $dark-text-primary;
    }
}

// --------------------------------------------------------------------------
// Navigation
// --------------------------------------------------------------------------
.primary-navigation {
    display: none;
    flex: 1;
    justify-content: center;

    @include media-up(lg) {
        display: flex;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;

    @include rtl {
        flex-direction: row-reverse;
    }
}

.menu-item > a {
    display: block;
    padding: 0.5rem 0;
    font-size: $font-size-sm;
    font-weight: $font-weight-medium;
    color: $light-text-secondary;
    text-decoration: none;
    transition: color $transition-base;

    &:hover {
        color: $color-primary;
    }

    body.dark-mode & {
        color: $dark-text-secondary;

        &:hover {
            color: $color-primary;
        }
    }
}

.menu-item.current-menu-item > a {
    color: $color-primary;
}

// --------------------------------------------------------------------------
// Header Actions
// --------------------------------------------------------------------------
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    @include rtl {
        flex-direction: row-reverse;
    }
}

.header-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: $border-radius;
    color: $light-text-secondary;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all $transition-base;

    &:hover {
        color: $color-primary;
        background: $light-bg-tertiary;
    }

    body.dark-mode & {
        color: $dark-text-secondary;

        &:hover {
            background: $dark-border-color;
        }
    }
}

// Hide desktop buttons on mobile
.header-actions .btn-login,
.header-actions .btn-primary-glow {
    display: none;

    @include media-up(lg) {
        display: inline-flex;
    }
}

// Login Button
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 1rem;
    gap: 0.5rem;
    background: $light-bg-tertiary;
    border: none;
    border-radius: $border-radius;
    color: $light-text-primary;
    font-size: $font-size-sm;
    font-weight: $font-weight-bold;
    text-decoration: none;
    cursor: pointer;
    transition: all $transition-base;

    &:hover {
        background: $light-border-color;
    }

    body.dark-mode & {
        background: $dark-border-color;
        color: $dark-text-primary;

        &:hover {
            background: $dark-border-light;
        }
    }
}

// Logout button styles
.site-header .header-actions .btn-logout {
    background: $color-danger;
    color: #ffffff;
    font-weight: $font-weight-extrabold;
    box-shadow: 0 0 15px rgba($color-danger, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);

    &:hover {
        background: darken($color-danger, 10%);
        box-shadow: 0 0 20px rgba($color-danger, 0.6);
    }
}

// Primary Glow Button
.btn-primary-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 1rem;
    gap: 0.5rem;
    background: $color-primary;
    border: none;
    border-radius: $border-radius;
    color: $dark-bg-primary;
    font-size: $font-size-sm;
    font-weight: $font-weight-bold;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 15px rgba($color-primary, 0.3);
    transition: all $transition-base;

    &:hover {
        background: $color-primary-hover;
        color: $dark-bg-primary;
        box-shadow: 0 0 20px rgba($color-primary, 0.5);
    }

    body.dark-mode & {
        color: #000000;
        font-weight: $font-weight-extrabold;
    }
}

// Language Toggle Icon
.lang-icon-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: $light-bg-tertiary;
    color: $light-text-primary;
    font-weight: $font-weight-bold;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all $transition-base;
    text-transform: uppercase;
    border: 1px solid $light-border-color;

    &:hover {
        background: $color-primary;
        color: $dark-bg-primary;
        border-color: $color-primary;
        transform: translateY(-2px);
    }

    body.dark-mode & {
        background: rgba(255, 255, 255, 0.1);
        color: $dark-text-primary;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

// --------------------------------------------------------------------------
// Theme Toggle Icons
// --------------------------------------------------------------------------
// Light mode (default): show moon icon (click to switch to dark)
.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: inline-block;
}

// Dark mode: show sun icon (click to switch to light)
body.dark-mode .theme-toggle .icon-sun {
    display: inline-block;
}

body.dark-mode .theme-toggle .icon-moon {
    display: none;
}

// Mobile Nav Toggle
.mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    color: $light-text-primary;
    font-size: 1.5rem;
    cursor: pointer;

    @include media-up(lg) {
        display: none;
    }

    body.dark-mode & {
        color: $dark-text-primary;
    }
}

// --------------------------------------------------------------------------
// News Ticker Bar
// --------------------------------------------------------------------------
.news-ticker-bar {
    background: $light-bg-secondary;
    border-bottom: 1px solid $light-border-color;
    padding: 0.5rem 0;
    overflow: hidden;

    body.dark-mode & {
        background: $dark-bg-secondary;
        border-bottom-color: $dark-border-color;
    }
}

.news-ticker-inner {
    display: flex;
    align-items: center;
    gap: 1rem;

    @include rtl {
        flex-direction: row-reverse;
    }
}

.ticker-badge {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: $font-weight-bold;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    background: rgba($color-primary, 0.2);
    color: $color-primary;
    border-radius: $border-radius-sm;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 1.25rem;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    position: absolute;

    @include rtl {
        flex-direction: row-reverse;
        animation-direction: reverse;
    }
}

.ticker-item {
    font-size: 0.75rem;
    color: $light-text-secondary;

    body.dark-mode & {
        color: $dark-text-secondary;
    }
}

.ticker-separator {
    color: $light-text-muted;

    body.dark-mode & {
        color: $dark-text-muted;
    }
}

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

// --------------------------------------------------------------------------
// Mobile Menu (Offcanvas)
// --------------------------------------------------------------------------
.offcanvas {
    background: $light-bg-primary;
    border-left: 1px solid $light-border-color;

    @include rtl {
        border-left: none;
        border-right: 1px solid $light-border-color;
    }

    body.dark-mode & {
        background: $dark-bg-primary;
        border-left-color: $dark-border-color;
    }
}

.offcanvas-header {
    padding: 1.5rem;
    border-bottom: 1px solid $light-border-color;

    body.dark-mode & {
        border-bottom-color: $dark-border-color;
    }
}

.offcanvas-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 900;
    color: $light-text-primary;

    .bi {
        font-size: 1.5rem;
    }

    @include rtl {
        flex-direction: row-reverse;
    }

    body.dark-mode & {
        color: $dark-text-primary;
    }
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;

    .menu-item > a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
        font-weight: $font-weight-medium;
        color: $light-text-secondary;
        text-decoration: none;
        border-bottom: 1px solid $light-border-color;
        transition: color $transition-base;

        &:hover {
            color: $color-primary;
        }

        body.dark-mode & {
            color: $dark-text-secondary;
            border-bottom-color: $dark-border-color;
        }
    }
}

.mobile-actions {
    border-color: $light-border-color;

    body.dark-mode & {
        border-color: $dark-border-color;
    }
}

// --------------------------------------------------------------------------
// Admin Bar Offset
// --------------------------------------------------------------------------
.admin-bar .header-wrapper {
    top: 32px;

    @media screen and (max-width: 782px) {
        top: 46px;
    }
}

.admin-bar .presszone-dashboard-sidebar {
    top: 32px;
    height: calc(100vh - 32px);

    @media screen and (max-width: 782px) {
        top: 46px;
        height: calc(100vh - 46px);
    }
}
