/* ============================================================
   SHIMAX AI - MASTER SYSTEM STYLESHEET (PRODUCTION HIGH-END WEB)
   ============================================================ */

/* ─── 1. VARS & THEMING ────────────────────────────────────── */
:root {
    /* Fonts */
    --font-dana: 'Dana', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-yekan: 'IRANYekan', 'Yekan', sans-serif;
    --font-vazir: 'Vazirmatn', sans-serif;

    /* Brand Emerald Palette */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-glow: rgba(16, 185, 129, 0.35);

    /* Text Tones (Deep Solid Web Shades) */
    --text-menu-solid: #09090b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --danger-text: #ef4444;

    /* Light Theme (Clean Minimalist Glass) */
    --bg-page: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.88);
    --surface-card: #ffffff;
    --border-color: rgba(226, 232, 240, 0.85);
    --border-hover: rgba(16, 185, 129, 0.4);

    /* Shadows & Effects */
    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-dropdown: 0 20px 40px -12px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px var(--emerald-glow);
    --glass-blur: blur(16px);
}

[data-theme="dark"] {
    --text-menu-solid: #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --bg-page: #090d16;
    --surface-glass: rgba(15, 23, 42, 0.88);
    --surface-card: #131b2e;
    --border-color: rgba(51, 65, 85, 0.65);
    --border-hover: rgba(52, 211, 153, 0.5);

    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 20px 45px -10px rgba(0, 0, 0, 0.7);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* ─── 2. BASE RESET & VIEWPORT ─────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-dana);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    padding-top: 78px;
}

.font-dana { font-family: var(--font-dana); }
.font-yekan { font-family: var(--font-yekan); }
.font-vazir { font-family: var(--font-vazir); }

/* ─── 3. DYNAMIC STICKY & FLOATING HEADER ─────────────────── */
/* ============================================================
   SHIMAX MASTER HEADER - PROFESSIONAL GLASSMORPHISM
   ============================================================ */

.shimax-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 78px; /* ارتفاع استاندارد تعریف شده در قوانین پروژه */
    z-index: 1000;
    display: flex;
    align-items: center;
    background: var(--surface-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);

    /* بهینه‌سازی برای GPU */
    transform: translateY(0);
    will-change: transform;

    /* انیمیشن‌های نرم سینمایی */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease,
                backdrop-filter 0.3s ease;
}

/* ۱. حالت مخفی شدن هدر (Auto-Hide در اسکرول به پایین) */
.shimax-header.header--hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

/* ۲. حالت فلوتینگ (Scrolled) - تم روشن */
.shimax-header.header--scrolled {
    height: 70px; /* کمی باریک‌تر شدن برای دید بهتر محتوا */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(16, 185, 129, 0.2);
}

/* ۳. حالت فلوتینگ (Scrolled) - تم تاریک */
[data-theme="dark"] .shimax-header.header--scrolled {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    border-bottom-color: rgba(52, 211, 153, 0.2);
}

/* ۴. استایل داخلی کانتینر هدر برای حفظ فواصل */
.header-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ۵. جلوگیری از پرش محتوا (طبق قوانین پروژه) */
body {
    padding-top: 78px;
}

/* 3.1 Brand Identity */
.header-brand-side {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.45));
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-link:hover .brand-logo-img {
    transform: scale(1.08) rotate(-4deg);
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.8));
}

.brand-name {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-menu-solid);
    line-height: 1;
}

.brand-dot {
    width: 7px;
    height: 7px;
    background-color: var(--emerald-500);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--emerald-500);
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* 3.2 Enterprise Clean Text Menus */
.header-central-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    color: var(--text-menu-solid);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
    color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.07);
}

.arrow-indicator {
    font-size: 0.72rem !important;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s ease;
}

.nav-link:hover .arrow-indicator,
.has-dropdown:hover .arrow-indicator,
.has-dropdown.is-open .arrow-indicator {
    color: var(--emerald-500);
    transform: rotate(180deg);
}

/* Dropdown Panel Container */
.dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.65rem;
    margin-top: 8px;
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

/* Invisible bridge to prevent mouse flicker */
.dropdown-panel::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

/* Dropdown Interactions */
.has-dropdown:hover .dropdown-panel,
.has-dropdown.is-open .dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.95rem;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(16, 185, 129, 0.04);
}

.dropdown-item:hover .item-title {
    color: var(--emerald-500);
}

.item-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-menu-solid);
    transition: color 0.2s ease;
}

.item-desc {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.5;
}

.badge-version {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    align-self: flex-start;
}

/* 3.3 Right Controls & User Profile */
.header-control-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-card);
    color: var(--text-menu-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.2s ease;
    min-width: 42px;
}

.theme-toggle-btn:hover {
    border-color: var(--emerald-500);
    color: var(--emerald-500);
    transform: rotate(15deg);
}

.theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: inline-block; color: #fbbf24; }

.user-profile-menu {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 0.65rem;
    padding: 4px 6px 4px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.user-profile-trigger:hover {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.04);
}

.user-avatar-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.user-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-menu-solid);
}

/* User Dropdown Positioned Safely to Left */
.user-profile-menu .user-dropdown {
    position: absolute;
    top: 100%;
    right: auto;
    left: 0;
    width: 280px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.65rem;
    margin-top: 12px;
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

.user-profile-menu:hover .user-dropdown,
.user-profile-menu.is-open .user-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Tiny connection arrow */
.user-dropdown::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--surface-card);
    transform: rotate(45deg);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    z-index: -1;
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.03);
    border-radius: 16px 16px 0 0;
    margin-bottom: 0.4rem;
}

.user-email {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
    text-align: left;
    direction: ltr;
    word-break: break-all;
}

.logout-link {
    margin-top: 5px;
    color: var(--danger-text) !important;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logout-link i {
    font-size: 1.2rem;
    color: var(--danger-text);
    order: 2;
}

.logout-link:hover {
    background: var(--danger-bg);
}

.logout-link:hover .item-title {
    color: var(--danger-text);
}

/* ─── 4. LAYOUT & HERO SECTION ─────────────────────────────── */
.main-viewport {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.shimax-hero-container {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.shimax-brand-title {
    font-size: 4.2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--emerald-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.shimax-brand-slogan {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    font-weight: 500;
    line-height: 1.8;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── 5. DESKTOP/LAPTOP OPTIMIZATION (1025px - 1280px) ─────── */
@media (min-width: 1025px) and (max-width: 1280px) {
    .header-container {
        padding: 0 1.25rem;
    }
    .nav-link {
        padding: 0.5rem 0.65rem;
        font-size: 0.88rem;
    }
    .brand-name {
        font-size: 1.3rem;
    }
}

/* ─── 6. MOBILE & TABLET GATEWAY (MAX-WIDTH 1024PX) ────────── */
.mobile-app-gateway {
    display: none;
}

@media (max-width: 1024px) {
    .shimax-header,
    main,
    footer,
    .shimax-footer,
    .main-viewport,
    .content-wrapper {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
        overflow: hidden !important;
        height: 100vh !important;
        background: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.15), transparent 70%), var(--bg-page);
    }

    .mobile-app-gateway {
        display: flex !important;
        position: fixed;
        inset: 0;
        z-index: 999999;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
    }

    .gateway-card {
        background: var(--surface-card);
        border: 1px solid var(--border-color);
        border-radius: 28px;
        padding: 2.75rem 2rem;
        text-align: center;
        max-width: 440px;
        width: 100%;
        box-shadow: var(--shadow-card);
        backdrop-filter: blur(20px);
        animation: gatewayCardPop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .gateway-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .gateway-logo {
        width: 56px;
        height: 56px;
        object-fit: contain;
        filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.5));
    }

    .gateway-badge {
        background: var(--emerald-50);
        color: var(--emerald-700);
        font-size: 0.78rem;
        font-weight: 800;
        padding: 0.3rem 0.85rem;
        border-radius: 20px;
        border: 1px solid var(--emerald-200);
    }

    [data-theme="dark"] .gateway-badge {
        background: rgba(16, 185, 129, 0.15);
        color: var(--emerald-400);
        border-color: rgba(16, 185, 129, 0.3);
    }

    .gateway-title {
        font-size: 1.35rem;
        font-weight: 900;
        color: var(--text-primary);
        line-height: 1.4;
        margin-bottom: 0.85rem;
    }

    .gateway-desc {
        font-size: 0.92rem;
        color: var(--text-secondary);
        line-height: 1.8;
        margin-bottom: 2rem;
    }

    .btn-download-bazaar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.85rem;
        background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
        color: #ffffff !important;
        text-decoration: none;
        padding: 0.9rem 1.75rem;
        border-radius: 18px;
        box-shadow: 0 10px 25px var(--emerald-glow);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .btn-download-bazaar i {
        font-size: 1.6rem;
    }

    .btn-text-group {
        display: flex;
        flex-direction: column;
        text-align: right;
    }

    .btn-subtext {
        font-size: 0.72rem;
        opacity: 0.85;
        font-weight: 500;
    }

    .btn-maintext {
        font-size: 1.05rem;
        font-weight: 900;
    }

    .btn-download-bazaar:active {
        transform: scale(0.97);
    }
}

@keyframes gatewayCardPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
/* SHIMAX HERO DOWNLOAD BAR - PERFECTLY INTEGRATED */
.shimax-download-section {
    width: 100%;
    margin-top: 2.5rem; /* ایجاد فاصله مناسب از متن شعار بالا */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.download-bar-container {
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.download-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap; /* در مانیتورهای کوچک‌تر دکمه‌ها بدون شکستن استایل در صف بعدی قرار گیرند */
    flex-direction: row-reverse; /* چیدمان منظم از راست به چپ برای پایداری فونت و ساختار */
}

/* Base Card Style */
.dl-card {
    position: relative;
    text-decoration: none;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.7rem 1.5rem;
    height: 48px; /* ارتفاع ثابت برای جلوگیری از هرگونه بهم‌ریختگی تراز دکمه‌ها */
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dl-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.dl-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Icons */
.dl-brand-icon {
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    line-height: 1;
}

.dl-brand-icon-svg {
    width: 20px;
    height: 20px;
    color: #10b981;
}

/* Specific Colors */
.play-color {
    color: #34d399;
}

.apple-color {
    color: var(--text-primary);
}

.simple-card .dl-brand-name {
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.2px;
}

/* Bazaar Special / Verified Style */
.bazaar-card {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.03);
}

.dl-badge-verified {
    position: absolute;
    top: -11px;
    right: 50%;
    transform: translateX(50%);
    background: var(--emerald-500);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    z-index: 2;
}

/* Hover Effects */
.dl-card:hover {
    transform: translateY(-4px);
    border-color: var(--emerald-500);
    background: var(--surface-card);
    box-shadow: 0 12px 25px -8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .dl-card:hover {
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
}

/* Responsive Hide for Mobile/Tablet */
@media (max-width: 1024px) {
    .shimax-download-section {
        display: none !important;
    }
}
/* ============================================================
   FIXED FULL-WIDTH CINEMATIC HERO VIDEO (FULL EDGE-TO-EDGE)
   ============================================================ */

/* ۱. باز کردن تمام پدینگ‌ها و محدودیت‌های والد */
body,
.main-viewport,
.content-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
}

/* ۲. کانتینر هیرو تمام‌عرض */
.shimax-hero-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2.5rem 0 3.5rem 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ۳. متون بالا در مرکز (محدود به کادر متنی) */
.hero-header-text {
    width: 100%;
    max-width: 900px;
    text-align: center;
    margin: 0 auto 2.5rem auto;
    padding: 0 1.5rem;
}

/* ۴. ویدیو کاملاً چسبیده به دو دیوار راست و چپ با ارتفاع بلند */
.shimax-hero-video-wrapper {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    height: 720px !important; /* ارتفاع بلند و پرقدرت */
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: #000;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.hero-video-element {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}

/* ۵. اورلی محوکننده لبه‌های بالا و پایین */
.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        var(--bg-page) 0%,
        transparent 10%,
        transparent 90%,
        var(--bg-page) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* ۶. دانلود بار زیر ویدیو */
.shimax-download-section {
    width: 100%;
    margin-top: 3.5rem !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1.5rem;
}

/* responsive height adjustment without breaking full-width */
@media (max-width: 1440px) {
    .shimax-hero-video-wrapper {
        height: 580px !important;
    }
}

@media (max-width: 1200px) {
    .shimax-hero-video-wrapper {
        height: 480px !important;
    }
}
