/* iOS Glass Modal */
.ios-glass {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 10000;
}

.ios-glass.show {
    display: flex;
}

.ios-glass-card {
    position: relative;
    width: 90%;
    max-width: 320px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #fff;
    text-align: center;
    animation: iosUp .35s ease;
}

@keyframes iosUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ios-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-size: 14px;
    text-align: right;
}

.ios-step i {
    font-size: 20px;
    opacity: .9;
}

.ios-ok {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: #00c853;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* ===============================
   GLOBAL DESIGN SYSTEM
================================ */
:root {
    --bg-main: #0b0f1a;
    --bg-glass: rgba(255, 255, 255, 0.045);
    --bg-glass-hover: rgba(255, 255, 255, 0.075);
    --border-glass: rgba(255, 255, 255, 0.09);

    --primary: #7c5cff;
    --primary-soft: rgba(124, 92, 255, 0.18);
    --accent: #3ddc97;
    --danger: #ff6b6b;

    --text-main: #ffffff;
    --text-muted: #9aa4bf;

    --radius-xl: 42px;
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 14px;

    --shadow-soft: 0 25px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 40px rgba(124, 92, 255, 0.45);

    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme=light] .sidebar-glass-pro {
    border: 1px solid rgb(0 0 0 / 17%);
    box-shadow: none;
}
.edu-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 45px;
    direction: ltr;
    padding: 50px 0;
}

/* ===============================
   HERO SECTION
================================ */
.hero-premium {
    position: relative;
    height: 460px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.hero-premium::after {
    content: "";
    position: absolute;
    inset: 1;
    background: linear-gradient(to left,
            rgba(11, 15, 26, 0.25),
            rgba(11, 15, 26, 0.85));
    z-index: 1;
}

.hero-bg-wrapper {
    width: 60%;
}

.hero-bg-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-glass-card {
    position: relative;
    z-index: 2;

    backdrop-filter: blur(18px);

    padding: 45px;
    border-radius: var(--radius-lg);
    margin-right: 45px;
    max-width: 560px;
    animation: fadeInRight 0.8s ease-out;
}

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 900;
    margin-bottom: 22px;
}

.pulse-icon {
    width: 9px;
    height: 9px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--primary);
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -1px;
    margin-bottom: 15px;
}

.hero-desc {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.8;
}

/* ===============================
   BUTTONS
================================ */
.hero-actions {
    display: flex;
    gap: 15px;
    margin-top: 35px;
}

.btn-main {
    background: linear-gradient(135deg, #7c5cff, #9a7bff);
    color: #fff;
    border: none;
    padding: 15px 34px;
    border-radius: var(--radius-md);
    font-weight: 900;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(124, 92, 255, 0.55);
}

.btn-icon-glass {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-glass:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.video-card-glass {
    cursor: pointer;
    transform-origin: center;
}

.video-card-glass.is-active {
    animation: videoSelect 0.45s ease forwards;
    z-index: 10;
}

@keyframes videoSelect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

/* ===============================
   GRID HEADER
================================ */
.grid-header-pro {
    margin: 55px 0 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-header-pro h3 {
    font-size: 1.7rem;
    font-weight: 900;
}

.status-indicator {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

.filter-pills {
    display: flex;
    gap: 12px;
}

.pill {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 9px 22px;
    border-radius: 100px;
    color: var(--text-muted);
    font-weight: 800;
    transition: var(--transition);
}

.pill.active,
.pill:hover {
    background: var(--primary);
    color: #fff;
}

/* ===============================
   VIDEO GRID
================================ */
.video-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.video-card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.video-card-glass:hover {
    transform: translateY(-10px);
    background: var(--bg-glass-hover);
    border-color: var(--primary-soft);
}

.v-preview {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.v-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s;
}

.video-card-glass:hover img {
    transform: scale(1.08);
}

.v-duration-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
}

.v-play-btn-center {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: var(--transition);
}

.video-card-glass:hover .v-play-btn-center {
    opacity: 1;
}

.v-play-btn-center i {
    width: 62px;
    height: 62px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
}

.v-progress-track {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.v-progress-fill {
    height: 100%;
    background: var(--primary);
}

/* ===============================
   CONTENT
================================ */
.v-content {
    padding: 20px 10px 10px;
}

.v-category {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--accent);
}

.v-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 8px 0 14px;
}

.v-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    padding-top: 14px;
}

/* ===============================
   SIDEBAR
================================ */
.sidebar-glass-pro {
    position: sticky;
    top: 110px;
    background: var(--bg-glass);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}
[data-theme=light] .sidebar-label {
        color: #454545;
}
.sidebar-label {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 5px;
    padding: 15px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}
[data-theme=light] .nav-item.active{
        background: rgb(124 92 255 / 75%);
}
[data-theme=light] .nav-item:hover {
        background: rgb(124 92 255 / 75%);
}
.nav-item.active,
.nav-item:hover {
    background: var(--primary-soft);
    color: #fff;
}
[data-theme=light] .hero-premium{
    box-shadow: none;
    border: 1px solid #9f9d9d36;
    background: none;
}
[data-theme=light] .hero-title{
    color: #020617;
}
[data-theme=light] .hero-desc{
    color: #8d9ac3;
}
[data-theme=light] .video-card-glass{
    box-shadow: none;
        border: 1px solid rgb(0 0 0 / 16%);
}
[data-theme=light] .v-duration-tag {
    background: rgb(181 181 181 / 65%);
}
[data-theme=light]
[data-theme=light] .ni-icon {
    background: rgb(255 255 255 / 20%);
}
.ni-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===============================
   PROMO
================================ */
.promo-card {
    margin-top: 35px;
    background: linear-gradient(135deg, #7c5cff, #3ddc97);
    border-radius: var(--radius-md);
    padding: 26px;
    text-align: center;
}

.btn-promo {
    background: #fff;
    color: #000;
    border: none;
    padding: 11px 26px;
    border-radius: 14px;
    font-weight: 900;
    margin-top: 18px;
    cursor: pointer;
}

/* ===============================
   ANIMATIONS
================================ */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(124, 92, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-premium {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 6%;
    min-height: 520px;
    background: radial-gradient(circle at top right, #241a49, #020617 70%);
    overflow: hidden;
    direction: rtl;
}

/* ---------- Content ---------- */
.hero-content {
    z-index: 2;
    max-width: 540px;
}

.hero-glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 36px 34px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
}



/* ---------- Text ---------- */
.hero-title {
    font-size: 34px;
    font-weight: 900;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 14px;
}

.hero-desc {
    font-size: 16px;
    line-height: 1.9;
    color: #cbd5f5;
    margin-bottom: 26px;
}

/* ---------- Buttons ---------- */
.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, #573bf6, #7125eb);
    color: #fff;
    padding: 12px 26px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ===============================
   VIDEO MODAL - نسخه بهبودیافته و responsive
================================ */
.video-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    /* مهم: برای جلوگیری از مشکلات اسکرول و centering در موبایل */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* اسکرول نرم در iOS */
}

.video-modal.show {
    display: flex;
    /* تغییر بزرگ: از block به flex */
    align-items: center;
    /* وسط‌چین عمودی */
    justify-content: center;
    /* وسط‌چین افقی */
}

.video-modal-backdrop {
    position: fixed;
    /* تغییر به fixed برای پوشش کامل صفحه */
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    /* برای iOS */
    z-index: 1;
    /* پشت کارت */
}

/* کارت اصلی مودال */
.video-modal-card {
    position: relative;
    width: 90%;
    max-width: 860px;
    /* حذف margin: 6vh auto → چون حالا flex parent داریم */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 26px;
    padding: 22px;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 2;
    /* بالای backdrop */
    animation: scaleIn 0.35s ease;
}

/* انیمیشن ورود (بدون مشکل reflow) */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* دکمه بستن */
.video-close {
    position: absolute;
    top: 14px;
    left: 14px;
    /* در RTL باید right باشد؟ اگر dir=rtl است: right:14px; left:auto; */
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.2s;
}

.video-close:hover {
    transform: scale(1.15);
}

/* wrapper ویدیو */
.video-frame-wrapper {
    margin-top: 18px;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #0b0f1a;
    /* fallback اگر iframe لود نشود */
    position: relative;
}

.video-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* انیمیشن کارت ویدیو لیست (بدون تغییر) */
.video-card-glass.is-active {
    animation: cardTap 0.45s ease;
}

@keyframes cardTap {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive - موبایل و تبلت */
@media (max-width: 768px) {
    .video-modal-card {
        width: 94%;
        /* کمی عریض‌تر برای موبایل */
        padding: 16px;
        /* فضای کمتر */
        border-radius: 20px;
        margin: 2vh auto;
        /* fallback اگر flex مشکل داشت */
    }

    .video-close {
        font-size: 24px;
        top: 12px;
        left: 12px;
    }

    /* اگر مودال خیلی بلند شد، اسکرول داخلی بده */
    .video-modal.show {
        align-items: flex-start;
        /* از وسط به بالا بچسبد تا اسکرول راحت‌تر باشد */
        padding-top: 4vh;
    }
}

/* برای دستگاه‌هایی که backdrop-filter ضعیف کار می‌کند (بعضی اندروید قدیمی) */
@supports not (backdrop-filter: blur(1px)) {
    .video-modal-backdrop {
        background: rgba(0, 0, 0, 0.65);
        /* fallback سنگین‌تر */
    }

    .video-modal-card {
        background: rgba(20, 25, 40, 0.95);
        /* fallback مات‌تر */
    }
}

/* ---------- Image ---------- */
.hero-bg-wrapper {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.hero-bg-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center,
            transparent 40%,
            rgba(2, 6, 23, 0.9) 90%);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .hero-premium {
        flex-direction: column-reverse;
        text-align: center;
        padding: 60px 5%;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }
}

.balanced-hero {
    display: grid;

    align-items: center;
    gap: 40px;
    padding: 80px 6%;
}

/* ---------- Text Side ---------- */
.hero-text {
    max-width: 520px;
    z-index:9;
}

/* ---------- Image Side ---------- */
.hero-media {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* کلیک‌پذیر نباشه */
}

.hero-media img {
    position: absolute;
    bottom: -4px;
    left: 25px;
    width: 384px;
    opacity: 0.8;
    z-index: 1;
    filter: blur(0.2px);
}

/* ---------- Actions ---------- */
.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 14px;
}

/* ---------- Mobile ---------- */
@media (max-width: 992px) {
    .balanced-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-media {
        order: -1;
    }

    .hero-actions {
        justify-content: center;
    }
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 1100px) {
    .edu-wrapper {
        grid-template-columns: 1fr;
    }

    .hero-premium {
        height: auto;
        padding: 30px;
    }

    .hero-glass-card {
        margin-right: 0;
        max-width: 100%;
    }
}