﻿/* ==================================================
   HEADER STYLES
   ================================================== */

/* ==================================================
   1. ROOT VARIABLES
   ================================================== */
:root {
    --gold-primary: #C89B3C;
    --gold-light: #D9B15B;
    --gold-dark: #B88628;
    --dark-bg: #08111F;
    --dark-card: #07101D;
    --text-light: #d6dde6;
    --text-muted: #BFC7D2;
    --white: #FFFFFF;
    --transition: .35s cubic-bezier(.4, 0, .2, 1);
    --shadow-gold: rgba(200, 155, 60, .30);
    /* 👇 متغيرات التحكم في ارتفاع الهيدر */
    --top-bar-height: 44px;
    --main-header-height: 84px;
    --header-total-height: calc(var(--top-bar-height) + var(--main-header-height));
}

/* ==================================================
   2. BODY PADDING (لدفع المحتوى تحت الهيدر)
   ================================================== */
body {
    padding-top: var(--header-total-height);
    margin: 0;
    transition: var(--transition);
}

/* ==================================================
   3. HEADER CONTAINER
   ================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99999;
    transition: var(--transition);
}

/* ==================================================
   4. TOP BAR
   ================================================== */
.top-bar {
    height: var(--top-bar-height);
    background: var(--dark-card);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    transition: var(--transition);
    overflow: hidden;
}

.top-content {
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ----- Top Bar Right ----- */
.top-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

    .top-right span {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--text-light);
        font-size: 13px;
    }

    .top-right i {
        color: var(--gold-primary);
    }

/* ----- Top Bar Left (Social Icons) ----- */
.top-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .top-left a {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        transition: var(--transition);
        text-decoration: none;
    }

        .top-left a:hover {
            background: rgba(255, 255, 255, .08);
            color: var(--gold-primary);
            transform: translateY(-2px);
        }

        .top-left a:focus-visible {
            outline: 2px solid var(--gold-primary);
            outline-offset: 2px;
        }

/* ==================================================
   5. MAIN HEADER
   ================================================== */
.main-header {
    background: rgba(8, 17, 31, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    transition: var(--transition);
}

.navbar-custom {
    height: var(--main-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ==================================================
   6. LOGO
   ================================================== */
.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--white);
    text-decoration: none;
    flex-shrink: 0;
}

    .logo:hover {
        color: var(--white);
    }

.logo-box {
    width: 72px;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    /* الإطار الذهبي */
    border: 3px solid #D4AF37;
    /* بروز الإطار */
    box-shadow: 0 0 0 4px rgba(212,175,55,.18), 0 10px 25px rgba(0,0,0,.25), inset 0 0 12px rgba(255,255,255,.35);
    transition: .35s ease;
}

    .logo-box img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.logo:hover .logo-box {
    transform: rotate(-4deg) scale(1.05);
    box-shadow: 0 25px 50px rgba(200, 155, 60, .40);
}

.logo-text h3 {
    color: var(--white);
    font-size: 25px;
    margin: 0;
    line-height: 1.2;
}

.logo-text span {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: .5px;
    display: block;
}

/* ==================================================
   7. NAVIGATION MENU
   ================================================== */
.menu {
    display: flex;
    align-items: center;
    gap: 34px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .menu li {
        position: relative;
    }

        .menu li a {
            position: relative;
            display: block;
            color: var(--white);
            font-size: 16px;
            font-weight: 600;
            padding: 10px 0;
            text-decoration: none;
            transition: var(--transition);
        }

            .menu li a::after {
                content: "";
                position: absolute;
                right: 0;
                bottom: 0;
                width: 0;
                height: 2px;
                background: var(--gold-primary);
                transition: var(--transition);
            }

            .menu li a:hover {
                color: var(--gold-primary);
            }

                .menu li a:hover::after {
                    width: 100%;
                    right: auto;
                    left: 0;
                }

            .menu li a:focus-visible {
                outline: 2px solid var(--gold-primary);
                outline-offset: 2px;
            }

/* ==================================================
   8. HEADER BUTTON
   ================================================== */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 28px;
    border-radius: 50px;
    background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 15px 35px var(--shadow-gold);
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

    .header-btn:hover {
        color: var(--white);
        transform: translateY(-4px);
        box-shadow: 0 20px 45px rgba(200, 155, 60, .40);
    }

    .header-btn:active {
        transform: translateY(-1px);
    }

    .header-btn:focus-visible {
        outline: 2px solid var(--gold-primary);
        outline-offset: 2px;
    }

/* ==================================================
   9. STICKY HEADER (SCROLLED STATE)
   ================================================== */

.header.scrolled {
    box-shadow: 0 15px 35px rgba(0,0,0,.18);
}

    /* لا تخفي الـ Top Bar */

    .header.scrolled .top-bar {
        height: var(--top-bar-height);
        opacity: 1;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    /* لا تصغر الهيدر */

    .header.scrolled .navbar-custom {
        height: var(--main-header-height);
    }

    /* لا تصغر اللوجو */

    .header.scrolled .logo-box {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .header.scrolled .logo-text h3 {
        font-size: 25px;
    }

    .header.scrolled .logo-text span {
        font-size: 13px;
    }
/* ==================================================
   10. RESPONSIVE BREAKPOINTS
   ================================================== */

/* ----- Tablet Landscape ----- */
@media (max-width: 1200px) {
    .menu {
        gap: 22px;
    }
}

/* ----- Tablet Portrait ----- */
@media (max-width: 992px) {
    /* 👇 إعادة تعيين المتغيرات للتابلت */
    :root {
        --top-bar-height: 0px;
        --main-header-height: auto;
        --header-total-height: auto;
    }

    body {
        padding-top: 0;
    }

    .top-bar {
        display: none;
    }

    .navbar-custom {
        flex-direction: column;
        height: auto;
        gap: 22px;
        padding: 22px 0;
    }

    .menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px;
    }

    .header-btn {
        width: 220px;
    }
}

/* ----- Mobile Landscape ----- */
@media (max-width: 768px) {
    .logo {
        gap: 12px;
    }

    .logo-box {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .logo-text h3 {
        font-size: 20px;
    }

    .logo-text span {
        font-size: 11px;
    }

    .menu {
        gap: 14px;
    }

        .menu li a {
            font-size: 15px;
        }
}

/* ----- Mobile Portrait ----- */
@media (max-width: 576px) {
    .container {
        width: calc(100% - 30px);
        padding-left: 15px;
        padding-right: 15px;
    }

    .navbar-custom {
        gap: 18px;
        padding: 18px 0;
    }

    .header-btn {
        width: 100%;
    }
}

/* ----- Extra Small Devices ----- */
@media (max-width: 400px) {
    .logo-box {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .logo-text h3 {
        font-size: 18px;
    }

    .logo-text span {
        font-size: 10px;
    }

    .menu li a {
        font-size: 14px;
        padding: 8px 0;
    }

    .menu {
        gap: 10px;
    }

    .header-btn {
        height: 46px;
        font-size: 14px;
        padding: 0 20px;
    }
}

/* ==================================================
   11. ACCESSIBILITY & UTILITY
   ================================================== */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Print Styles */
@media print {
    .header {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
    }
}
