/* ==========================================================================
   سامانه آموزشی درس پژوهش | طراحی مدرن، واکنش‌گرا و مینیمال (Modern Clean UI)
   ========================================================================== */

:root {
    color-scheme: light;
    --bg-main: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --primary: #0F766E;
    --primary-hover: #115E59;
    --primary-light: #F0FDFA;
    --secondary: #F1F5F9;
    --secondary-dark: #E2E8F0;
    --border: #E2E8F0;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 36px -4px rgba(15, 23, 42, 0.08), 0 6px 14px -2px rgba(15, 23, 42, 0.03);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
}

*:focus {
    outline: none !important;
}

button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent !important;
}

*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

html, body {
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main.container {
    padding-top: 22px;
    padding-bottom: 90px;
}

/* ==========================================================================
   نوار ناوبری بالا (Header)
   ========================================================================== */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    flex-shrink: 0;
    white-space: nowrap;
}

.brand-subtitle {
    display: none !important;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #0D4E37);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(22, 122, 88, 0.2);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent !important;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-outline {
    background-color: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-outline:hover {
    background-color: var(--secondary);
    border-color: #CBD5E1;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: #FEE2E2;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* User Badge */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.user-badge {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    background-color: var(--secondary) !important;
    padding: 3px 12px 3px 6px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    height: 38px !important;
    max-height: 38px !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(22, 122, 88, 0.2) !important;
    overflow: hidden !important;
}

.user-avatar {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary), #0D4E37) !important;
    color: #FFFFFF !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.user-name {
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    max-width: 130px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--text-main) !important;
    line-height: 1.2 !important;
    display: inline-block !important;
}

.role-pill {
    padding: 2px 8px !important;
    border-radius: 999px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.role-student {
    background-color: #E0E7FF;
    color: #3730A3;
}

.role-teacher {
    background-color: #DCFCE7;
    color: #166534;
}

/* Notif */
.notif-wrapper {
    position: relative;
}

.notif-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.notif-btn:hover {
    background-color: var(--secondary);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background-color: var(--danger);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-dropdown {
    position: absolute;
    top: 48px;
    left: 0;
    width: 320px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.notif-dropdown.active {
    display: block;
}

.notif-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.88rem;
    background-color: var(--bg-main);
}

.notif-clear-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.notif-list {
    max-height: 280px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover {
    background-color: var(--bg-main);
}

.notif-item.unread {
    background-color: var(--primary-light);
}

.notif-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-item-title {
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.notif-item-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.notif-item-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   بنر جذاب و شیک ابتدای صفحه ویدیوها (Hero Card)
   ========================================================================== */
.hero-welcome-card {
    background: linear-gradient(135deg, #0F766E 0%, #0D9488 45%, #042F2E 100%);
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    margin: 20px 0 24px;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-shadow: 0 16px 36px -6px rgba(15, 118, 110, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-welcome-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-welcome-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: 15%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    flex: 1;
    z-index: 2;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #F8FAFC;
}

.hero-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #4ADE80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ADE80;
}

.hero-title {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #FFFFFF;
    letter-spacing: -0.5px;
}

.hero-desc {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    max-width: 580px;
    margin-bottom: 20px;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 20px;
    border-radius: var(--radius-full);
}

.hero-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-stat-number {
    font-size: 1.15rem;
    font-weight: 900;
    color: #FFFFFF;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-stat-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2;
    flex-shrink: 0;
}

.btn-hero-primary {
    background: #FFFFFF;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.92rem;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-primary:hover {
    background: #F1F5F3;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.btn-hero-outline {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-2px);
}

/* ==========================================================================
   نوار دسته‌بندی و فیلترها (Filter Bar)
   ========================================================================== */
.filter-bar {
    padding: 18px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tab-btn:hover {
    background-color: var(--secondary);
    color: var(--text-main);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: #0F766E;
    color: #FFFFFF;
    border-color: #0F766E;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

.tab-badge {
    background-color: var(--secondary);
    color: var(--text-main);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
}

.tab-btn.active .tab-badge {
    background-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.search-wrap {
    position: relative;
    min-width: 260px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background-color: var(--card-bg);
    color: var(--text-main);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: #FFFFFF;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ==========================================================================
   گرید کارت‌های ویدیو (Video Grid)
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.video-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(23, 26, 24, 0.09);
    border-color: rgba(22, 122, 88, 0.3);
}

.card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: linear-gradient(135deg, #167A58, #0D4E37);
    overflow: hidden;
}

.card-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .card-thumb {
    transform: scale(1.04);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    z-index: 2;
    backdrop-filter: blur(6px);
}

.badge-completed {
    background-color: rgba(22, 122, 88, 0.92);
    color: #FFFFFF;
}

.badge-in_progress {
    background-color: rgba(237, 108, 2, 0.92);
    color: #FFFFFF;
}

.badge-unwatched {
    background-color: rgba(23, 26, 24, 0.75);
    color: #FFFFFF;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(23, 26, 24, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-circle {
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.card-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
}

.card-progress-fill {
    height: 100%;
    background-color: var(--primary);
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.card-teacher {
    font-weight: 600;
    color: var(--primary);
}

/* Empty */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ==========================================================================
   مودال‌ها (Modals)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 26, 24, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3500;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 4000 !important;
}

.modal {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-lg {
    max-width: 900px;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background-color: var(--card-bg);
    z-index: 10;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-main);
    background-color: var(--secondary);
}

.modal-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Auth Tabs */
.auth-nav {
    display: flex;
    border-bottom: 2px solid var(--secondary);
    margin-bottom: 20px;
}

.auth-nav-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.auth-nav-btn.active {
    color: var(--primary);
}

.auth-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
}

/* Player Specifics */
.player-container {
    width: 100%;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    margin-bottom: 20px;
}

.player-container video,
.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.player-progress-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

.desc-box {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 24px;
    line-height: 1.7;
    font-size: 0.92rem;
}

.comments-header {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.comment-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.88rem;
}

/* Teacher Dashboard */
.dash-nav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.dash-nav-btn {
    background: none;
    border: 1px solid transparent;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.dash-nav-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.85rem;
}

.data-table th {
    background-color: var(--secondary);
    color: var(--text-main);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background-color: var(--card-bg);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--text-main);
    color: #FFFFFF;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-success { background-color: var(--primary); }
.toast-error { background-color: var(--danger); }

/* ==========================================================================
   سوئیچر بخش‌های اصلی در هدر (Nav Views Switcher)
   ========================================================================== */
.nav-views {
    display: inline-flex;
    align-items: center;
    background-color: var(--secondary);
    padding: 3px;
    border-radius: var(--radius-full);
    gap: 4px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.view-btn:hover {
    color: var(--text-main);
}

.view-btn.active {
    background-color: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   بخش گروه‌ها و کانال‌های تلگرامی کلاسی (Classroom Community & Chat)
   ========================================================================== */
.community-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: calc(100vh - 100px);
    min-height: 580px;
    margin: 18px 0 24px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* سایدبار لیست گروه‌ها و کانال‌ها */
.community-sidebar {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background-color: var(--card-bg);
    overflow: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-search-wrap {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-main);
}

.groups-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.group-item:hover {
    background-color: var(--secondary);
}

.group-item.active {
    background-color: var(--primary-light);
    border-color: rgba(22, 122, 88, 0.2);
}

.group-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-info {
    flex: 1;
    min-width: 0;
}

.group-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.group-name {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.group-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.group-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.group-last-msg {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.group-type-badge {
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
}

.badge-channel {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-group {
    background-color: #E0E7FF;
    color: #3730A3;
}

/* پنل اصلی اتاق چت */
.community-chat {
    display: flex;
    flex-direction: column;
    background-color: #FAFBF9;
    height: 100%;
    overflow: hidden;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.chat-header {
    height: 64px;
    padding: 0 20px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.chat-header-details {
    display: flex;
    flex-direction: column;
}

.chat-header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.chat-header-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* نوار پیام سنجاق شده تلگرامی (Pinned Message) */
.pinned-message-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: var(--transition);
}

.pinned-message-bar:hover {
    background-color: var(--secondary);
}

.pinned-bar-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pinned-bar-icon {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pinned-bar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pinned-bar-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
}

.pinned-bar-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-unpin-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    transition: var(--transition);
}

.pinned-unpin-btn:hover {
    color: var(--danger);
    background-color: rgba(211, 47, 47, 0.1);
}

/* انیمیشن جهش به پیام پین شده */
@keyframes highlightPulse {
    0% { background-color: rgba(22, 122, 88, 0.35); transform: scale(1.02); }
    100% { background-color: transparent; transform: scale(1); }
}

.highlight-pulse .chat-bubble {
    animation: highlightPulse 1.8s ease-out;
}

/* لیست پیام‌ها و والپیپرهای تلگرام */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.3s ease;
}

.chat-messages.wallpaper-emerald_doodle {
    background-color: #F0F4F1;
    background-image: radial-gradient(#167a58 0.8px, transparent 0.8px), radial-gradient(#167a58 0.8px, #F0F4F1 0.8px);
    background-size: 26px 26px;
    background-position: 0 0, 13px 13px;
}

.chat-messages.wallpaper-clean_white {
    background-color: #F7F8F6;
    background-image: none;
}

.chat-messages.wallpaper-soft_mint {
    background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%);
}

.chat-messages.wallpaper-slate_dark {
    background-color: #1E293B;
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 24px 24px;
}

.chat-messages.wallpaper-slate_dark .chat-bubble-wrap.other .chat-bubble {
    background-color: #334155;
    color: #F8FAFC;
    border-color: #475569;
}

.chat-messages.wallpaper-slate_dark .chat-bubble-wrap.other .bubble-sender {
    color: #93C5FD;
}

.chat-messages.wallpaper-slate_dark .chat-bubble-wrap.other .bubble-bottom {
    color: #94A3B8;
}

.chat-messages.wallpaper-warm_sand {
    background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%);
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.chat-bubble-wrap.mine {
    align-self: flex-start;
}

.chat-bubble-wrap.other {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
}

.chat-bubble-wrap.mine .chat-bubble {
    background: linear-gradient(135deg, #167A58 0%, #115F44 100%);
    border: none;
    border-radius: 18px 18px 4px 18px;
    color: #FFFFFF;
    box-shadow: 0 3px 12px rgba(22, 122, 88, 0.22);
}

.chat-bubble-wrap.mine .bubble-sender {
    color: #A7F3D0;
}

.chat-bubble-wrap.mine .bubble-bottom {
    color: #D1FAE5;
}

.chat-bubble-wrap.mine .bubble-file {
    background-color: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
    border-radius: 12px;
}

.chat-bubble-wrap.other .chat-bubble {
    background-color: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px 18px 18px 4px;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bubble-sender {
    font-weight: 800;
    font-size: 0.78rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sender-teacher {
    color: #059669;
}

.sender-student {
    color: #4F46E5;
}

.bubble-text {
    white-space: pre-wrap;
}

.bubble-media {
    margin-top: 6px;
    border-radius: 14px;
    overflow: hidden;
}

.bubble-image {
    max-width: 100%;
    max-height: 280px;
    border-radius: 14px;
    cursor: pointer;
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.bubble-video {
    max-width: 100%;
    max-height: 280px;
    border-radius: 14px;
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.bubble-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.04);
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 6px;
    transition: var(--transition);
}

.bubble-file:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.bubble-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.btn-msg-pin {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
}

.btn-msg-pin:hover {
    opacity: 1;
}

.btn-msg-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
}

.btn-msg-delete:hover {
    opacity: 1;
}

/* نوار ورودی چت مدرن و شناور */
.chat-footer {
    padding: 12px 18px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-attach-btn, .chat-emoji-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: #F8FAF9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-attach-btn:hover, .chat-emoji-btn:hover {
    background-color: var(--secondary);
    color: var(--primary);
    transform: scale(1.05);
}

.chat-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background-color: #F8FAF9;
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    resize: none;
    line-height: 1.5;
    transition: var(--transition);
}

.chat-input:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #0F5E43 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(22, 122, 88, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-send-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 18px rgba(22, 122, 88, 0.45);
}

.chat-input:focus {
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* پیش‌نمایش فایل انتخاب شده */
.chat-attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-light);
    border: 1px solid rgba(22, 122, 88, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* جعبه سریع ایموجی */
.emoji-tray {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.emoji-tray.active {
    display: flex;
}

.emoji-item {
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: transform 0.15s;
    user-select: none;
}

.emoji-item:hover {
    transform: scale(1.25);
    background-color: var(--secondary);
}

.chat-readonly-banner {
    padding: 12px 16px;
    background-color: #FEF3C7;
    border-radius: var(--radius-sm);
    color: #92400E;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ==========================================================================
   سیستم تماس صوتی و تصویری گروهی کلاسی (Voice & Video Calls)
   ========================================================================== */
.group-call-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: linear-gradient(135deg, #167A58, #0D4E37);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(22, 122, 88, 0.25);
    z-index: 12;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.call-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.call-pulse-dot {
    width: 12px;
    height: 12px;
    background-color: #22C55E;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: callPulse 1.5s infinite;
}

@keyframes callPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.call-banner-title {
    font-size: 0.9rem;
    font-weight: 800;
}

.call-banner-sub {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* ==========================================================================
   طراحی استاندارد کلاس آنلاین و محیط تعاملی اسکای‌روم (Skyroom Online Classroom)
   ========================================================================== */
.call-modal-overlay.skyroom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0B1320;
    z-index: 5000;
    display: none;
    flex-direction: column;
    color: #F8FAFC;
    overflow: hidden;
    user-select: none;
    transition: opacity 0.3s ease;
}

.call-modal-overlay.active {
    display: flex;
}

/* ۱. نوار هدر بالای کلاس اسکای‌روم */
.skyroom-header {
    height: 56px;
    background: #182234;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 50;
    gap: 12px;
}

.skyroom-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.skyroom-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0284C7, #0369A1);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
    flex-shrink: 0;
}

.skyroom-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.skyroom-room-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #F8FAFC;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.skyroom-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pulse-dot-green {
    width: 7px;
    height: 7px;
    background: #22C55E;
    border-radius: 50%;
    animation: livePulseDot 1.5s infinite;
}

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

.skyroom-header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.skyroom-timer-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #E2E8F0;
}

.skyroom-conn-status {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94A3B8;
}

.conn-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.conn-bars i {
    width: 3px;
    background: #22C55E;
    border-radius: 1px;
    display: inline-block;
}

.conn-bars .b1 { height: 4px; }
.conn-bars .b2 { height: 8px; }
.conn-bars .b3 { height: 12px; }

.skyroom-stage-switchers {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: var(--radius-full);
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-tab-btn {
    border: none;
    background: transparent;
    color: #94A3B8;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.stage-tab-btn.active {
    background: #0284C7;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.skyroom-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.skyroom-btn-danger-pill {
    background: #EF4444;
    color: #FFFFFF;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transition: opacity 0.2s;
}

.skyroom-btn-danger-pill:hover {
    background: #DC2626;
}

.skyroom-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.skyroom-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.skyroom-exit-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.skyroom-exit-btn:hover {
    background: #EF4444;
    color: #FFFFFF;
}

/* تب‌های موبایل اسکای‌روم */
.skyroom-mobile-nav {
    display: none;
    height: 42px;
    background: #131D2A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    padding: 0 8px;
    align-items: center;
    justify-content: space-around;
}

.skyroom-mob-tab {
    flex: 1;
    height: 34px;
    border: none;
    background: transparent;
    color: #94A3B8;
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.skyroom-mob-tab.active {
    background: rgba(2, 132, 199, 0.15);
    color: #38BDF8;
}

.unread-dot {
    position: absolute;
    top: 6px;
    left: 12px;
    width: 6px;
    height: 6px;
    background: #EF4444;
    border-radius: 50%;
}

/* ۲. بدنه فضای کاری اسکای‌روم (Stage + Sidebar) */
.skyroom-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ستون استیج اصلی */
.skyroom-main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #0B1320;
    position: relative;
    overflow: hidden;
}

/* حالت ۱: کانتینر ویدیوها */
.skyroom-video-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
    overflow-y: auto;
    min-height: 0;
}

/* کادر بزرگ ارائه‌دهنده (معلم) */
.skyroom-spotlight-box {
    flex: 1;
    min-height: 220px;
    background: #131E30;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.spotlight-header {
    position: absolute;
    top: 12px;
    right: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

.spotlight-badge {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
}

.spotlight-mic-icon {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ADE80;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.spotlight-media-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at 50% 40%, rgba(2, 132, 199, 0.12) 0%, rgba(11, 19, 32, 0.85) 75%);
}

.spotlight-media-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotlight-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.spotlight-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284C7, #0F766E);
    color: #FFFFFF;
    font-size: 2.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(2, 132, 199, 0.35);
}

.spotlight-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #F8FAFC;
}

.spotlight-role {
    font-size: 0.8rem;
    color: #94A3B8;
}

/* نوار سایر شرکت‌کنندگان */
.skyroom-attendees-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
    min-height: 110px;
}

.skyroom-peer-card {
    width: 150px;
    height: 105px;
    background: #182234;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.skyroom-peer-card.is-local {
    border-color: rgba(2, 132, 199, 0.4);
}

.skyroom-peer-card.is-speaking {
    border-color: #22C55E;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.skyroom-peer-card.hand-raised {
    border-color: #F59E0B;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
    animation: handRaisedGlow 1.4s infinite;
}

@keyframes handRaisedGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.peer-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.peer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F766E, #115E59);
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.peer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 6px;
}

.peer-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.peer-role {
    font-size: 0.62rem;
    color: #94A3B8;
}

.peer-status-icons {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
}

.peer-status-pill {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 6px;
}

/* دوربین‌های شرکت‌کنندگان و بهینه‌سازی وب‌کم */
.skyroom-peer-card video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
    z-index: 1;
    background: #000000;
}

video.is-mirror {
    transform: scaleX(-1);
}

.skyroom-peer-card .peer-avatar-wrap {
    z-index: 2;
    transition: opacity 0.2s ease;
}

.skyroom-peer-card.has-video .peer-avatar-wrap .peer-avatar {
    display: none;
}

.skyroom-peer-card.has-video .peer-avatar-wrap {
    position: absolute;
    bottom: 4px;
    right: 6px;
    background: rgba(15, 23, 42, 0.7);
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.skyroom-peer-card .peer-status-icons {
    z-index: 3;
}

/* دکمه تغییر حالت چیدمان دوربین‌ها */
.btn-cam-layout-toggle {
    pointer-events: auto !important;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #F8FAFC;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-cam-layout-toggle:hover {
    background: rgba(2, 132, 199, 0.8);
    border-color: #38BDF8;
}

/* حالت چیدمان گرید همه دوربین‌ها (Equal Multi-cam Grid) */
.skyroom-video-container.grid-view .skyroom-spotlight-box {
    display: none;
}

.skyroom-video-container.grid-view .skyroom-attendees-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

.skyroom-video-container.grid-view .skyroom-peer-card {
    width: 100%;
    height: 100%;
    min-height: 160px;
}

/* حالت ۲: تخته سفید تعاملی اسکای‌روم (Whiteboard) */
.skyroom-whiteboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #F1F5F9;
    min-height: 0;
    position: relative;
}

.whiteboard-toolbar {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

.wb-tool-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wb-btn {
    border: 1px solid #CBD5E1;
    background: #F8FAFC;
    color: #334155;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.wb-btn:hover {
    background: #E2E8F0;
}

.wb-btn.active {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #0284C7;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.wb-tool-divider {
    width: 1px;
    height: 22px;
    background: #E2E8F0;
}

.wb-color-picker {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wb-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px #CBD5E1;
    transition: transform 0.15s;
}

.wb-color-dot:hover {
    transform: scale(1.15);
}

.wb-color-dot.active {
    box-shadow: 0 0 0 2px #0284C7;
    transform: scale(1.2);
}

.wb-select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
}

.wb-action-btn {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.wb-action-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.whiteboard-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

#skyroomCanvas {
    background: #FFFFFF;
    display: block;
    touch-action: none;
}

/* ستون کناری اسکای‌روم (سایدبار کاربران و چت) */
.skyroom-sidebar {
    width: 330px;
    min-width: 280px;
    max-width: 360px;
    background: #182234;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.skyroom-side-tabs {
    height: 48px;
    background: #131D2A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
    flex-shrink: 0;
}

.side-tab-btn {
    flex: 1;
    height: 36px;
    border: none;
    background: transparent;
    color: #94A3B8;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    transition: all 0.2s;
}

.side-tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tab-badge {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

.side-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

/* پنل لیست کاربران */
.teacher-quick-tools {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.users-group-section {
    padding: 10px 12px;
}

.users-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 800;
    color: #94A3B8;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.group-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
}

.users-list-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skyroom-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.15s;
}

.skyroom-user-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.skyroom-user-row.hand-active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
}

.user-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.user-row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-row-avatar.teacher {
    background: linear-gradient(135deg, #0284C7, #0369A1);
}

.user-row-avatar.student {
    background: linear-gradient(135deg, #0F766E, #115E59);
}

.user-row-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-row-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-row-role {
    font-size: 0.65rem;
    color: #94A3B8;
}

.user-row-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.user-badge-hand {
    background: #F59E0B;
    color: #000000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    animation: livePulseDot 1.2s infinite;
}

.user-action-btn {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.user-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-action-btn.allow-mic {
    background: rgba(34, 197, 94, 0.2);
    color: #4ADE80;
}

.user-action-btn.mute-mic {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

/* پنل چت کلاس */
.skyroom-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-system-msg {
    text-align: center;
    font-size: 0.72rem;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1.5;
}

.skyroom-chat-bubble {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 12px;
    gap: 4px;
}

.skyroom-chat-bubble.is-me {
    background: rgba(2, 132, 199, 0.2);
    border-right: 3px solid #0284C7;
}

.skyroom-chat-bubble.is-teacher {
    border-right: 3px solid #22C55E;
}

.chat-bubble-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
}

.chat-bubble-sender {
    font-weight: 800;
    color: #F8FAFC;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-bubble-time {
    color: #64748B;
    font-size: 0.65rem;
}

.chat-bubble-text {
    font-size: 0.82rem;
    line-height: 1.5;
    color: #E2E8F0;
    word-break: break-word;
}

.skyroom-chat-input-bar {
    background: #131D2A;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.chat-quick-emojis {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
}

.chat-quick-emojis span {
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.15s;
}

.chat-quick-emojis span:hover {
    transform: scale(1.3);
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    outline: none;
}

.chat-form input:focus {
    border-color: #0284C7;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0284C7;
    border: none;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: #0369A1;
}

/* ۳. نوار ابزار پایین کلاس اسکای‌روم (Dock) */
.skyroom-footer {
    height: 68px;
    background: #131D2A;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 50;
    padding: 0 16px;
}

.skyroom-dock {
    display: flex;
    align-items: center;
    gap: 14px;
}

.skyroom-dock-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skyroom-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent !important;
}

.skyroom-tool-btn .tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.skyroom-tool-btn:hover .tool-icon {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.skyroom-tool-btn .tool-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94A3B8;
}

/* وضعیت‌های فعال و هشدار نوار ابزار */
.skyroom-tool-btn.active .tool-icon {
    background: #0284C7;
    border-color: #38BDF8;
    box-shadow: 0 0 14px rgba(2, 132, 199, 0.5);
}

.skyroom-tool-btn.muted .tool-icon {
    background: rgba(239, 68, 68, 0.85);
    border-color: #DC2626;
    color: #FFFFFF;
}

.skyroom-tool-btn.hand-tool.is-raised .tool-icon {
    background: #F59E0B;
    border-color: #FBBF24;
    color: #000000;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
    animation: handRaisedGlow 1.2s infinite;
}

.skyroom-tool-btn.hand-tool.is-raised .tool-label {
    color: #F59E0B;
    font-weight: 800;
}

.skyroom-tool-btn.leave-tool .tool-icon {
    background: #EF4444;
    border-color: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.skyroom-tool-btn.leave-tool:hover .tool-icon {
    background: #DC2626;
}

.skyroom-dock-btn-wrap.mob-only {
    display: none;
}

/* ==========================================================================
   ریسپانسیو نسخه موبایل اسکای‌روم (Mobile Responsive Classroom)
   ========================================================================== */
@media (max-width: 768px) {
    .call-modal-overlay.skyroom-modal {
        padding: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
    }

    .skyroom-header {
        height: 48px;
        padding: 0 6px;
        gap: 4px;
    }

    .skyroom-header-right {
        gap: 6px;
        min-width: 0;
        flex: 1;
    }

    .skyroom-logo-badge {
        display: none !important;
    }

    .skyroom-title-wrap {
        min-width: 0;
    }

    .skyroom-room-title {
        max-width: 120px;
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .skyroom-live-pill {
        padding: 2px 6px;
        font-size: 0.65rem;
    }

    .skyroom-header-center {
        gap: 4px;
        flex-shrink: 0;
    }

    .skyroom-conn-status {
        display: none !important;
    }

    .skyroom-stage-switchers {
        display: none !important;
    }

    .skyroom-timer-badge {
        padding: 2px 6px;
        font-size: 0.72rem;
    }

    .skyroom-header-left {
        gap: 4px;
        flex-shrink: 0;
    }

    .skyroom-header-left .skyroom-icon-btn {
        width: 28px;
        height: 28px;
    }

    .skyroom-header-left .skyroom-icon-btn svg {
        width: 14px;
        height: 14px;
    }

    .skyroom-btn-danger-pill {
        padding: 3px 7px;
        font-size: 0.68rem;
    }

    .skyroom-exit-btn {
        padding: 3px 8px;
        font-size: 0.72rem;
        gap: 3px;
    }

    .skyroom-exit-btn svg {
        width: 13px;
        height: 13px;
    }

    /* نوار ناوبری تب‌های ۴ گانه بالای کلاس در موبایل */
    .skyroom-mobile-nav {
        display: flex !important;
        height: 40px;
        background: #111A28;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0 4px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }

    .skyroom-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .skyroom-mob-tab {
        flex: 1;
        min-width: 72px;
        height: 32px;
        padding: 2px 6px;
        font-size: 0.7rem;
        gap: 4px;
        white-space: nowrap;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .skyroom-mob-tab.active {
        background: rgba(2, 132, 199, 0.22);
        color: #38BDF8;
        font-weight: 800;
        border-bottom: 2px solid #38BDF8;
    }

    .skyroom-body {
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .skyroom-main-stage {
        flex: 1;
        min-height: 0;
    }

    .skyroom-sidebar {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        height: 100%;
        display: none;
    }

    .skyroom-side-tabs {
        display: none !important;
    }

    /* کنترل نمایش تب‌ها در موبایل (تصویر و استیج، کتاب و فایل درسی، کاربران، چت) */
    .skyroom-modal.mob-view-stage .skyroom-main-stage,
    .skyroom-modal.mob-view-material .skyroom-main-stage {
        display: flex !important;
    }
    .skyroom-modal.mob-view-stage .skyroom-sidebar,
    .skyroom-modal.mob-view-material .skyroom-sidebar {
        display: none !important;
    }

    .skyroom-modal.mob-view-users .skyroom-main-stage,
    .skyroom-modal.mob-view-chat .skyroom-main-stage {
        display: none !important;
    }
    .skyroom-modal.mob-view-users .skyroom-sidebar,
    .skyroom-modal.mob-view-chat .skyroom-sidebar {
        display: flex !important;
    }

    .skyroom-modal.mob-view-users #panelUsers {
        display: flex !important;
    }
    .skyroom-modal.mob-view-users #panelChat {
        display: none !important;
    }

    .skyroom-modal.mob-view-chat #panelChat {
        display: flex !important;
    }
    .skyroom-modal.mob-view-chat #panelUsers {
        display: none !important;
    }

    /* کادر وبکم‌ها در موبایل */
    .skyroom-video-container {
        padding: 6px;
        gap: 6px;
    }

    .skyroom-spotlight-box {
        min-height: 160px;
        max-height: 55vh;
        border-radius: 12px;
    }

    .spotlight-header {
        top: 6px;
        right: 6px;
        left: 6px;
    }

    .spotlight-badge {
        font-size: 0.65rem;
        padding: 2px 7px;
    }

    .btn-cam-layout-toggle {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .spotlight-mic-icon {
        font-size: 0.64rem;
        padding: 2px 5px;
    }

    .spotlight-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }

    .spotlight-title {
        font-size: 0.88rem;
    }

    .spotlight-role {
        font-size: 0.68rem;
    }

    .skyroom-attendees-strip {
        min-height: 75px;
        gap: 6px;
        padding-bottom: 2px;
    }

    .skyroom-peer-card {
        width: 100px;
        height: 72px;
        border-radius: 10px;
    }

    .peer-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .peer-name {
        font-size: 0.64rem;
        max-width: 80px;
    }

    .peer-role {
        font-size: 0.54rem;
    }

    /* استیج کتاب و فایل درسی در موبایل */
    .material-toolbar {
        padding: 4px 6px;
        gap: 4px;
    }

    .mat-tool-group {
        gap: 3px;
        flex-wrap: wrap;
    }

    .mat-tool-divider {
        display: none;
    }

    .mat-btn {
        padding: 4px 7px;
        font-size: 0.68rem;
        gap: 3px;
    }

    .mat-title-box {
        min-width: 100px;
        max-width: 150px;
    }

    .mat-active-icon {
        font-size: 1rem;
    }

    .mat-active-title {
        font-size: 0.72rem;
        max-width: 110px;
    }

    .mat-nav-btn {
        width: 24px;
        height: 24px;
    }

    .mat-page-indicator {
        font-size: 0.66rem;
    }

    .mat-zoom-btn {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
    }

    .mat-zoom-label {
        font-size: 0.65rem;
        min-width: 24px;
    }

    .material-stage-viewport {
        padding: 6px;
    }

    .material-render-box img {
        max-width: 96vw;
        max-height: 52vh;
    }

    .materials-drawer {
        max-height: 220px;
        padding: 10px 12px;
    }

    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    /* داک پایینی کلاس در موبایل */
    .skyroom-footer {
        height: 60px;
        padding: 0 4px;
        padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
        background: #0E1624;
    }

    .skyroom-dock {
        gap: 3px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding: 0 4px;
    }

    .skyroom-dock::-webkit-scrollbar {
        display: none;
    }

    .skyroom-dock-btn-wrap {
        flex-shrink: 0;
        min-width: 42px;
    }

    .skyroom-tool-btn {
        gap: 2px;
    }

    .skyroom-tool-btn .tool-icon {
        width: 36px;
        height: 36px;
    }

    .skyroom-tool-btn .tool-icon svg {
        width: 17px;
        height: 17px;
    }

    .skyroom-tool-btn .tool-label {
        font-size: 0.56rem;
    }

    .whiteboard-toolbar {
        padding: 4px 6px;
        gap: 4px;
    }

    .wb-btn {
        padding: 3px 6px;
        font-size: 0.68rem;
    }

    .wb-action-btn {
        padding: 3px 7px;
        font-size: 0.68rem;
    }

    .wb-tool-divider {
        display: none;
    }
}

/* نوار شناور تماس مینیمایز شده در بالای صفحه (Minimized Bar) */
.minimized-call-bar {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 38, 28, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 50px;
    padding: 8px 18px;
    display: none;
    align-items: center;
    gap: 14px;
    color: #FFFFFF;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 2500;
    cursor: pointer;
    animation: slideDownBar 0.3s ease;
}

@keyframes slideDownBar {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* مدال دانلود اپلیکیشن و بنر موبایل */
.app-nav-btn {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

.app-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.app-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.app-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.app-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 12px;
}

.app-card.android .app-card-icon { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.app-card.ios .app-card-icon { background: rgba(100, 116, 139, 0.12); color: #475569; }
.app-card.windows .app-card-icon { background: rgba(2, 132, 199, 0.12); color: #0284C7; }

.app-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-main);
}

.app-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.mobile-app-banner {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 10px 14px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    border: 1px solid var(--border);
    z-index: 2000;
}

/* نوار ناوبری پایین صفحه مخصوص گوشی (Mobile Bottom Nav) */
.mobile-bottom-nav {
    display: none;
}

/* ==========================================================================
   حالت ۳: کتاب، جزوه و فایل درسی (Material / Textbook Viewer)
   ========================================================================== */
.skyroom-material-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0B1320;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.material-toolbar {
    background: #131E30;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 10;
}

.mat-tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mat-tool-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
}

.mat-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #E2E8F0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.mat-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.mat-btn.active {
    background: #0284C7;
    border-color: #0284C7;
    color: #FFFFFF;
}

.mat-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 160px;
}

.mat-active-icon {
    font-size: 1.2rem;
}

.mat-active-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #F8FAFC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.mat-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.mat-nav-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.mat-page-indicator {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94A3B8;
    padding: 0 4px;
}

.mat-zoom-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.85rem;
}

.mat-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mat-zoom-label {
    font-size: 0.75rem;
    color: #CBD5E1;
    min-width: 36px;
    text-align: center;
}

.material-stage-viewport {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #070D18;
    position: relative;
}

.material-render-box {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease-out;
}

.material-render-box img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    background: #FFFFFF;
}

.material-empty-placeholder {
    max-width: 440px;
    text-align: center;
    padding: 40px 24px;
    background: #111A2C;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    color: #94A3B8;
}

.mat-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.material-empty-placeholder h4 {
    color: #F8FAFC;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.material-empty-placeholder p {
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* کشوی کتاب‌ها و جزوه‌ها */
.materials-drawer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131E30;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    padding: 14px 18px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 20;
    animation: drawerSlideUp 0.25s ease;
}

@keyframes drawerSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.drawer-header h5 {
    color: #F8FAFC;
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0;
}

.btn-drawer-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.btn-drawer-close:hover {
    color: #FFFFFF;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.material-card-item {
    background: #182234;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
}

.material-card-item:hover {
    border-color: #0284C7;
    background: #1F2D44;
    transform: translateY(-2px);
}

.material-card-item.active {
    border-color: #38BDF8;
    background: rgba(2, 132, 199, 0.2);
}

.material-card-icon {
    font-size: 1.6rem;
}

.material-card-title {
    color: #F8FAFC;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-card-meta {
    font-size: 0.7rem;
    color: #94A3B8;
}

/* ==========================================================================
   استایل‌های اختصاصی مودال ویرایش پیشرفته گروه (Group Settings Modern Modal)
   ========================================================================== */
.group-edit-modal {
    max-width: 640px !important;
}

.group-edit-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-hover, #F1F5F9);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 18px;
    overflow-x: auto;
}

.group-edit-tab-btn {
    flex: 1;
    min-width: 105px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
    white-space: nowrap;
}

.group-edit-tab-btn.active {
    background: var(--bg-surface, #FFFFFF);
    color: var(--primary, #0F766E);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.group-edit-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* کارت‌های انتخاب والپیپر چت گروه */
.wallpaper-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.wallpaper-card {
    height: 90px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wallpaper-card:hover {
    transform: translateY(-2px);
}

.wallpaper-card.active {
    border-color: var(--primary, #0F766E);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.25);
}

/* نوار انتخاب رنگ آواتار گروه */
.color-preset-strip {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.color-dot-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s;
}

.color-dot-btn:hover {
    transform: scale(1.15);
}

.color-dot-btn.active {
    box-shadow: 0 0 0 3px #0284C7;
}

/* سوییچ‌های تنظیمات دسترسی به سبک iOS */
.ios-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-hover, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.ios-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #0F766E);
    cursor: pointer;
}

/* دکمه تنظیمات گروه در هدر چت */
#btnHeaderGroupSettings {
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary, #0F766E);
    border: 1px solid rgba(15, 118, 110, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

#btnHeaderGroupSettings:hover {
    background: var(--primary, #0F766E);
    color: #FFFFFF;
}

/* ==========================================================================
   طراحی واکنش‌گرا و بهینه‌سازی دقیق موبایل (Full Mobile Responsive & Touch)
   ========================================================================== */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden !important;
        position: relative;
    }

    body {
        padding-bottom: 74px !important;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }

    /* پنهان کردن بنر شناور قدیمی تا هیچ المانی با ناوبری پایین تداخل پیدا نکند */
    .mobile-app-banner {
        display: none !important;
    }

    /* هدر واکنش‌گرا و بدون بیرون‌زدگی در تمام گوشی‌ها */
    .navbar {
        height: 58px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        width: 100%;
        max-width: 100vw;
    }

    .nav-wrapper {
        height: 58px;
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .navbar .nav-views {
        display: none !important;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-shrink: 0;
        min-width: 0;
        text-decoration: none;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        flex-shrink: 0;
    }

    .brand-title {
        font-size: 0.96rem !important;
        font-weight: 800;
        white-space: nowrap;
    }

    .brand-subtitle {
        display: none !important;
    }

    .nav-actions {
        display: flex !important;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .guest-nav {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .guest-nav .btn {
        padding: 6px 11px !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
        border-radius: var(--radius-full) !important;
        white-space: nowrap;
        gap: 4px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .guest-nav .btn svg {
        width: 14px;
        height: 14px;
    }

    .guest-nav .btn-primary {
        background: var(--primary) !important;
        color: #FFFFFF !important;
        box-shadow: 0 2px 10px rgba(22, 122, 88, 0.35) !important;
    }

    .guest-nav .btn-outline {
        border-color: var(--border) !important;
        background: #FFFFFF !important;
        color: var(--text-main) !important;
    }

    .user-menu, #userNav {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .teacher-btn-mobile {
        padding: 5px 9px !important;
        font-size: 0.74rem !important;
        font-weight: 800 !important;
        border-radius: var(--radius-full) !important;
        gap: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        background: var(--primary) !important;
        color: #FFFFFF !important;
        box-shadow: 0 2px 8px rgba(22, 122, 88, 0.35) !important;
    }

    .user-badge {
        padding: 0;
        background: transparent;
        display: inline-flex;
        align-items: center;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary), #0D4E37);
        color: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 800;
        box-shadow: 0 2px 6px rgba(22, 122, 88, 0.3);
        flex-shrink: 0;
    }

    .user-name {
        display: none !important;
    }

    .role-pill {
        display: none !important;
    }

    .notif-btn, .logout-btn {
        width: 32px;
        height: 32px;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        flex-shrink: 0;
    }

    /* بنر هیرو در موبایل (فشرده، جذاب و شیک) */
    .hero-welcome-card {
        flex-direction: column;
        padding: 14px 12px;
        margin: 8px 0 10px;
        text-align: center;
        gap: 10px;
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .hero-badge {
        font-size: 0.72rem;
        padding: 3px 10px;
        margin-bottom: 2px;
    }

    .hero-title {
        font-size: 1.05rem;
        line-height: 1.4;
        font-weight: 800;
        margin-bottom: 2px;
    }

    .hero-desc {
        display: none !important; /* پنهان کردن متن طولانی در موبایل تا ویدیوها بلافاصله دیده شوند */
    }

    .hero-stats {
        width: 100%;
        justify-content: space-around;
        gap: 4px;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        box-sizing: border-box;
        margin: 2px 0 4px;
    }

    .hero-stat-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 0;
    }

    .hero-stat-number {
        font-size: 1rem;
        font-weight: 800;
    }

    .hero-stat-label {
        font-size: 0.62rem;
        white-space: nowrap;
        opacity: 0.85;
    }

    .hero-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .btn-hero-primary, .btn-hero-outline {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: var(--radius-full);
        white-space: nowrap;
        user-select: none;
        -webkit-tap-highlight-color: transparent !important;
    }

    .btn-hero-primary:active, .btn-hero-outline:active {
        transform: scale(0.95);
    }

    .btn-hero-primary svg, .btn-hero-outline svg {
        width: 14px;
        height: 14px;
    }

    .filter-bar {
        padding: 8px 0 12px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .tabs {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .search-wrap {
        width: 100%;
        min-width: 0;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 24px;
        width: 100%;
    }

    /* مودال‌ها در موبایل (کامل و همیشه در دسترس بالای داک با پس‌زمینه کاملاً مات) */
    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
        z-index: 4000 !important;
        background-color: rgba(15, 23, 42, 0.75) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    .modal {
        background-color: #FFFFFF !important;
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        margin: 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-header {
        background-color: #FFFFFF !important;
        padding: 14px 16px;
        border-radius: 20px 20px 0 0;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 16px 16px 36px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        flex: 1;
    }

    /* ریسپانسیو اختصاصی مودال ویرایش گروه در موبایل */
    .group-edit-modal {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .group-edit-tabs {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding: 4px;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }

    .group-edit-tabs::-webkit-scrollbar {
        display: none;
    }

    .group-edit-tab-btn {
        min-width: 80px;
        padding: 6px 8px;
        font-size: 0.72rem;
        flex-shrink: 0;
    }

    .wallpaper-selector-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .wallpaper-card {
        height: 72px !important;
        font-size: 0.65rem !important;
    }

    .color-preset-strip {
        gap: 6px !important;
    }

    .color-dot-btn {
        width: 24px !important;
        height: 24px !important;
    }

    .ios-toggle-label {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
    }

    .group-avatar-customizer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* ریسپانسیو مودال دانلود اپ در موبایل */
    .app-download-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .app-card {
        padding: 14px 12px !important;
    }

    .notif-dropdown {
        position: fixed;
        top: 60px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .dash-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 6px;
    }

    .dash-nav-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .form-input, .form-select, .form-textarea {
        font-size: 16px !important;
    }

    /* داک ناوبری پایین صفحه مخصوص گوشی */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 2100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-nav-item {
        background: transparent;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 0.72rem;
        font-weight: 600;
        padding: 6px 4px;
        border-radius: 10px;
        transition: var(--transition);
        flex: 1;
        min-width: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item.active {
        color: var(--primary);
        font-weight: 800;
    }

    .mobile-nav-item.active svg {
        color: var(--primary);
        stroke-width: 2.6;
    }

    .mobile-nav-item:active {
        transform: scale(0.94);
    }

    /* Mobile Community & Chat */
    .main-content {
        padding: 6px 0 !important;
    }

    #communityViewSection {
        height: calc(100vh - 138px);
        height: calc(100dvh - 138px);
        display: flex;
        flex-direction: column;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }

    .community-layout {
        grid-template-columns: 1fr;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: var(--radius-md);
        width: 100%;
        overflow: hidden;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .community-chat {
        height: 100%;
        max-height: 100%;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #chatActiveContainer {
        height: 100%;
        max-height: 100%;
        flex: 1;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
    }

    .community-sidebar.hide-mobile {
        display: none !important;
    }

    .community-chat.hide-mobile {
        display: none !important;
    }

    .chat-header {
        padding: 0 8px;
        height: 50px;
        gap: 6px;
        flex-shrink: 0;
    }

    .chat-header-info {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .chat-header-title {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.88rem;
    }

    .chat-header-meta {
        font-size: 0.65rem;
    }

    #btnHeaderCall span,
    #btnHeaderGroupSettings span {
        display: none !important;
    }

    #btnHeaderCall,
    #btnHeaderGroupSettings {
        padding: 6px 9px !important;
        border-radius: var(--radius-full);
        flex-shrink: 0;
    }

    .chat-back-btn {
        display: inline-flex !important;
    }

    .chat-bubble-wrap {
        max-width: 88%;
    }

    .chat-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 8px;
    }

    .chat-footer {
        flex-shrink: 0;
        padding: 6px 8px;
        background: #FFFFFF;
        border-top: 1px solid var(--border);
    }

    .chat-input-bar {
        gap: 6px;
    }
}

/* ==========================================================================
   بخش‌های جدید: نوار دسترسی سریع بالا، دروس پایه نهم، نمونه سوالات و اخبار
   ========================================================================== */

/* ۱. نوار دسترسی سریع و چیپ‌های بالای صفحه (Top Navigation Chips Strip) */
.top-nav-strip-wrapper {
    margin-top: 10px;
    margin-bottom: 14px;
    position: relative;
    z-index: 10;
}

.top-nav-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-nav-strip::-webkit-scrollbar {
    display: none;
}

.top-nav-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.top-nav-chip:hover {
    border-color: var(--primary);
    background: rgba(22, 122, 88, 0.04);
    transform: translateY(-1px);
}

.top-nav-chip.active {
    background: linear-gradient(135deg, #167A58 0%, #10B981 100%);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(22, 122, 88, 0.28);
}

.top-nav-chip.active .chip-icon {
    transform: scale(1.1);
}

.top-nav-chip.highlight-chip {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.04);
}

.top-nav-chip.highlight-chip.active {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.chip-new-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #EF4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
    display: inline-block;
}

/* ۲. بنرهای مدرن و جمع‌وجور هدر هر بخش (Modern Section Header) */
.modern-section-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.msh-text {
    flex: 1;
}

.msh-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563EB;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
}

.msh-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.msh-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.btn-modern-upload {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 18px;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.25s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.btn-modern-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* ۳. شبکه تایل‌های جذاب دروس پایه نهم (Grade 9 Subjects Tiles Grid) */
.grade9-subjects-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.g9-subject-tile {
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all 0.22s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    -webkit-tap-highlight-color: transparent;
}

.g9-subject-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-color: #94A3B8;
}

.g9-subject-tile.active {
    border-color: var(--primary);
    background: rgba(22, 122, 88, 0.03);
    box-shadow: 0 4px 14px rgba(22, 122, 88, 0.12);
}

.g9-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.g9-tile-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.g9-tile-count-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: #F1F5F9;
    color: #475569;
}

.g9-subject-tile.active .g9-tile-count-badge {
    background: var(--primary);
    color: #FFFFFF;
}

.g9-tile-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g9-tile-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
}

/* ۴. نوار کنترل پست‌های درس نهم */
.g9-posts-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
    gap: 12px;
}

.g9-current-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.g9-active-icon {
    font-size: 1.4rem;
}

.g9-active-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.g9-active-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.grade9-media-switchers {
    display: inline-flex;
    background: var(--secondary);
    padding: 3px;
    border-radius: var(--radius-full);
    gap: 4px;
}

.grade9-filter-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.grade9-filter-btn.active {
    background: #FFFFFF;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ۵. شبکه کارت‌های مدیا و محتواهای درس نهم */
.grade9-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.grade9-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
    position: relative;
}

.grade9-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #CBD5E1;
}

.grade9-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #0F172A;
    overflow: hidden;
    cursor: pointer;
}

.grade9-card-media img,
.grade9-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grade9-card:hover .grade9-card-media img {
    transform: scale(1.03);
}

.grade9-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    z-index: 2;
}

.grade9-card-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease;
}

.grade9-card-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.grade9-card:hover .grade9-card-play-btn {
    transform: scale(1.1);
}

.grade9-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.grade9-card-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grade9-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.grade9-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 10px;
    margin-top: auto;
}

.grade9-author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.grade9-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-g9-like {
    background: transparent;
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-g9-like:hover {
    border-color: #EF4444;
    color: #EF4444;
}

/* ۶. استایل‌های بخش بانک نمونه سوالات امتحانی */
.questions-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.questions-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.questions-select-wrap .form-select {
    padding: 7px 12px;
    font-size: 0.84rem;
    border-radius: var(--radius-md);
}

.filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.question-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: #D97706;
}

.question-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.question-card-badge {
    background: rgba(217, 119, 6, 0.1);
    color: #D97706;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.question-term-badge {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.question-card-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 10px;
}

.question-answer-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-bottom: 14px;
}

.question-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 10px;
    margin-top: auto;
}

.question-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ۷. استایل‌های بخش رویدادها و اخبار مدرسه */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.news-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    border-color: #7C3AED;
}

.news-card-banner {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.news-type-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.news-date-badge {
    position: absolute;
    bottom: 8px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #0F172A;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.news-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 6px;
}

.news-card-content {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ۸. ناحیه درگ اند دراپ فایل */
.file-drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px 14px;
    text-align: center;
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-drop-area:hover,
.file-drop-area.dragover {
    border-color: var(--primary);
    background: rgba(22, 122, 88, 0.05);
}

/* ۹. بهینه‌سازی‌های ریسپانسیو اختصاصی موبایل */
@media (max-width: 768px) {
    .modern-section-header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }

    .btn-modern-upload {
        justify-content: center;
        width: 100%;
        padding: 11px;
    }

    .grade9-subjects-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .g9-subject-tile {
        padding: 10px 12px;
    }

    .g9-tile-icon-box {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .g9-tile-title {
        font-size: 0.84rem;
    }

    .g9-posts-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
    }

    .grade9-media-switchers {
        width: 100%;
        justify-content: space-between;
    }

    .grade9-filter-btn {
        flex: 1;
        text-align: center;
        padding: 5px 6px;
        font-size: 0.74rem;
    }

    .grade9-posts-grid,
    .questions-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .questions-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .questions-select-wrap {
        width: 100%;
    }

    .questions-select-wrap .form-select {
        flex: 1;
    }
}

/* ==========================================================================
   دسته‌بندی پیشرفته و چندسطحی نمونه سوالات (Sample Questions Advanced Categorization)
   ========================================================================== */

.q-categories-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-chips-wrapper {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.q-chips-wrapper::-webkit-scrollbar {
    display: none;
}

.q-chips-track {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-width: max-content;
    padding: 2px 2px;
}

.q-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.q-chip:hover {
    border-color: #D97706;
    background: #FFFBEB;
    transform: translateY(-1px);
}

.q-chip.active {
    background: linear-gradient(135deg, #D97706, #B45309) !important;
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3) !important;
}

.q-chip-icon {
    font-size: 1rem;
    line-height: 1;
}

.q-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.7rem;
    font-weight: 800;
    color: inherit;
}

.q-chip.active .q-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.q-sub-filter-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.q-term-filter-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.q-term-tab {
    background: #F1F5F9;
    color: var(--text-main);
    border: none;
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.q-term-tab:hover {
    background: #E2E8F0;
}

.q-term-tab.active {
    background: #D97706 !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3) !important;
}

.q-action-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.q-answer-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    user-select: none;
    white-space: nowrap;
}

.q-answer-filter-toggle input {
    accent-color: #D97706;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.q-filter-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 2px 6px;
}

.btn-clear-filters {
    background: none;
    border: none;
    color: #DC2626;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-clear-filters:hover {
    background: #FEF2F2;
}

/* فلش‌های جابجایی گالری چندتصویری */
.media-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #FFFFFF;
    border: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.media-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.08);
}

.media-nav-arrow.prev {
    right: 12px;
}

.media-nav-arrow.next {
    left: 12px;
}

.media-gallery-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    z-index: 10;
}


