/**
 * Unified Header Styling — Mobile-First
 * Location: /var/www/saafee/public/css/header.css
 */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.navbar-logo {
    width: 40px;
    height: 40px;
}

.premium-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #D4A017 0%, #F2C94C 100%);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    line-height: 1;
    align-self: flex-end;
    margin-bottom: 2px;
}

/* Mobile: hamburger visible, menu hidden */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Navigation menu — mobile default: hidden, vertical */
.navbar-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    gap: 0;
    z-index: 999;
}

.navbar-menu.show {
    display: flex;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    align-items: stretch;
}

.navbar-nav li {
    width: 100%;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: color 0.3s, background 0.3s;
    display: block;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: #E44335;
    background: #fff5f4;
}

.btn-get-premium {
    background: linear-gradient(135deg, #D4A017 0%, #F2C94C 100%);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: box-shadow 0.3s, transform 0.3s;
}

.btn-get-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.4);
}

/* Right section — mobile */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.navbar-user-link {
    color: #E44335;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-user-link:hover {
    color: #E44335;
    background: #fff5f4;
}

.btn-nav {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-auth {
    background: #E44335;
    color: white;
}

.btn-auth:hover {
    background: #C53727;
}

.nav-link-premium {
    color: #D4A017;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link-premium:hover {
    color: #B8860B;
    background: #fdf8ec;
}

/* RTL Support — mobile */
html[dir="rtl"] .navbar-menu {
    margin-right: 0;
}

html[dir="rtl"] .navbar-nav {
    flex-direction: column;
}

/*html[dir="rtl"] .navbar-right {
    flex-direction: row-reverse;
}*/

/* Desktop (768px+) */
@media (min-width: 768px) {
    .navbar {
        padding: 12px 20px;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .navbar-menu {
        display: flex;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 30px;
        flex: 1;
        margin-left: 40px;
        padding: 0;
        box-shadow: none;
        background: transparent;
    }

    .navbar-nav {
        flex-direction: row;
        gap: 20px;
        width: auto;
        align-items: center;
    }

    .navbar-nav li {
        width: auto;
    }

    .nav-link {
        display: inline-flex;
        width: auto;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .navbar-right {
        /*width: auto;*/
        flex-wrap: nowrap;
        gap: 16px;
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }

    /* RTL desktop */
    html[dir="rtl"] .navbar-menu {
        margin-left: 0;
        margin-right: 40px;
    }

    html[dir="rtl"] .navbar-nav {
        flex-direction: row;
    }
}
