/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* 🟢 کدهای جدید برای بارگذاری فونت محلی */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'),
          url('fonts/Vazirmatn-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'),
          url('fonts/Vazirmatn-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2'),
          url('fonts/Vazirmatn-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'),
          url('fonts/Vazirmatn-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2'),
          url('fonts/Vazirmatn-ExtraBold.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Black.woff2') format('woff2'),
          url('fonts/Vazirmatn-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 30%, #312e81 70%, #0f172a 100%);
    background-attachment: fixed;
    color: #f8fafc;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    padding: 2rem 0;
    margin: 1.5rem 0 2rem 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.main-logo {
    height: 120px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 8px 25px rgba(56, 189, 248, 0.4));
}

.main-logo:hover {
    transform: scale(1.05);
}

.title-section {
    text-align: center;
    direction: rtl;
}

.title-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-weight: 400;
}

/* Main content wrapper */
.main-wrapper {
    padding-bottom: 4rem;
}

/* Chapter grid */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Specific grid positioning for desktop view */
.chapter-card[data-chapter="10"] {
    grid-column: 1 / span 1;
}

.chapter-card[data-chapter="appendixA"] {
    grid-column: 1 / span 1;
}
.chapter-card[data-chapter="appendixB"] {
    grid-column: 2 / span 1;
}

.references-card {
    grid-column: 1 / span 1 !important;
    margin-top: 2rem;
}

.chapter-card {
    border-radius: 20px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    backdrop-filter: blur(15px);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

/* Harmonious blue gradient colors for all chapters */
.chapter-card:nth-child(1) { background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(59, 130, 246, 0.12)); border-color: rgba(56, 189, 248, 0.25); }
.chapter-card:nth-child(2) { background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.12)); border-color: rgba(59, 130, 246, 0.25); }
.chapter-card:nth-child(3) { background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12)); border-color: rgba(99, 102, 241, 0.25); }
.chapter-card:nth-child(4) { background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(168, 85, 247, 0.12)); border-color: rgba(139, 92, 246, 0.25); }
.chapter-card:nth-child(5) { background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(147, 51, 234, 0.12)); border-color: rgba(168, 85, 247, 0.25); }
.chapter-card:nth-child(6) { background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(126, 34, 206, 0.12)); border-color: rgba(147, 51, 234, 0.25); }
.chapter-card:nth-child(7) { background: linear-gradient(135deg, rgba(126, 34, 206, 0.12), rgba(107, 33, 168, 0.12)); border-color: rgba(126, 34, 206, 0.25); }
.chapter-card:nth-child(8) { background: linear-gradient(135deg, rgba(107, 33, 168, 0.12), rgba(88, 28, 135, 0.12)); border-color: rgba(107, 33, 168, 0.25); }
.chapter-card:nth-child(9) { background: linear-gradient(135deg, rgba(88, 28, 135, 0.12), rgba(79, 70, 229, 0.12)); border-color: rgba(88, 28, 135, 0.25); }
.chapter-card:nth-child(10) { background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(67, 56, 202, 0.12)); border-color: rgba(79, 70, 229, 0.25); }

/* Special styling for appendices (data-chapter with text) */
.chapter-card[data-chapter="appendixA"], .chapter-card[data-chapter="appendixB"] {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.12), rgba(55, 48, 163, 0.12));
    border: 2px solid rgba(67, 56, 202, 0.25);
    position: relative;
}

.chapter-card[data-chapter="appendixA"]::before, .chapter-card[data-chapter="appendixB"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(67, 56, 202, 0.08) 10px,
        rgba(67, 56, 202, 0.08) 20px
    );
    pointer-events: none;
}

.chapter-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.chapter-card:nth-child(1):hover { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 25px 50px rgba(99, 102, 241, 0.3); }
.chapter-card:nth-child(2):hover { border-color: rgba(16, 185, 129, 0.6); box-shadow: 0 25px 50px rgba(16, 185, 129, 0.3); }
.chapter-card:nth-child(3):hover { border-color: rgba(245, 101, 101, 0.6); box-shadow: 0 25px 50px rgba(245, 101, 101, 0.3); }
.chapter-card:nth-child(4):hover { border-color: rgba(251, 146, 60, 0.6); box-shadow: 0 25px 50px rgba(251, 146, 60, 0.3); }
.chapter-card:nth-child(5):hover { border-color: rgba(168, 85, 247, 0.6); box-shadow: 0 25px 50px rgba(168, 85, 247, 0.3); }
.chapter-card:nth-child(6):hover { border-color: rgba(14, 165, 233, 0.6); box-shadow: 0 25px 50px rgba(14, 165, 233, 0.3); }
.chapter-card:nth-child(7):hover { border-color: rgba(236, 72, 153, 0.6); box-shadow: 0 25px 50px rgba(236, 72, 153, 0.3); }
.chapter-card:nth-child(8):hover { border-color: rgba(34, 197, 94, 0.6); box-shadow: 0 25px 50px rgba(34, 197, 94, 0.3); }
.chapter-card:nth-child(9):hover { border-color: rgba(156, 163, 175, 0.6); box-shadow: 0 25px 50px rgba(156, 163, 175, 0.3); }
.chapter-card:nth-child(10):hover { border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 25px 50px rgba(245, 158, 11, 0.3); }
.chapter-card[data-chapter="appendixA"]:hover, .chapter-card[data-chapter="appendixB"]:hover {
    border-color: rgba(148, 163, 184, 0.8);
    box-shadow: 0 25px 50px rgba(148, 163, 184, 0.4);
}

.chapter-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.chapter-card:hover .chapter-image {
    transform: scale(1.05);
}

.chapter-content {
    padding: 1.5rem;
}

.chapter-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.chapter-description {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.chapter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.chapter-duration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.play-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(56, 189, 248, 0.1);
}

.chapter-card:hover .play-button {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.2);
    transform: translateX(-4px);
}

.appendix-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #f8fafc;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    animation: modal-appear 0.3s ease-out;
    color: #1f2937;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn {
    color: #9ca3af;
    float: left;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #374151;
}

.modal-content h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 2rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
}

.video-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.video-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
}

.answers-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.answers-btn:hover {
    background: linear-gradient(135deg, #0d9488, #047857);
    transform: translateY(-2px);
}

.files-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.files-btn:hover {
    background: linear-gradient(135deg, #e97317, #c2410c);
    transform: translateY(-2px);
}

.logo-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Video Page Styles */
#video-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    min-height: 100vh;
    padding: 1rem;
}

.video-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 100;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    text-decoration: none;
}

.home-btn {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #0f172a;
}

.home-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.chapters-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    position: relative;
}

.chapters-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.chapters-dropdown {
    position: relative;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.chapters-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: 384px;
    overflow-y: auto;
    z-index: 9999;
    padding: 0.5rem;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: right;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    color: #1f2937;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
    font-weight: 600;
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* 🔄 بازطراحی کامل فریم ویدیو و هاله آن */
.video-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 0.75rem;
    position: relative;
    padding: 0;
    overflow: hidden;
}

//* حل قطعی مشکل هاله ویدئو */
.video-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(139, 92, 246, 0.1));
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    z-index: -1;
    transition: all 0.3s ease;
}

.video-container:hover::before {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.5));
}


/* اصلاح برای محتوای درون ویدیو-کانتینر */
.video-container video, .video-container iframe {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
}

.video-info {
    text-align: center;
    margin-bottom: 2rem;
}

.video-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.video-description {
    color: #94a3b8;
    font-size: 1rem;
}

.video-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

#download-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

#download-btn:hover {
    background: linear-gradient(135deg, #e97317, #c2410c);
    transform: translateY(-2px);
}

#answers-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

#answers-btn:hover {
    background: linear-gradient(135deg, #0d9488, #047857);
    transform: translateY(-2px);
}

/* Loading states */
.video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #94a3b8;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(56, 189, 248, 0.3);
    border-radius: 50%;
    border-top-color: #38bdf8;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .title-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .logo-section {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }

    .video-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .video-actions {
        flex-direction: column;
        align-items: center;
    }

    .dropdown-content {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .chapter-content {
        padding: 1rem;
    }

    .chapter-title {
        font-size: 1.1rem;
    }

    .chapter-description {
        font-size: 0.875rem;
    }

    .video-frame {
        height: 250px;
    }

    .video-title {
        font-size: 1.5rem;
    }
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    margin: 4rem 0 1.5rem 0;
    padding: 3rem 0 2rem;
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.2));
    border: 3px solid rgba(56, 189, 248, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    backdrop-filter: blur(15px);
}

.footer-logo img {
    width: 60px;
    height: auto;
    filter: brightness(1.2);
}

.footer-section {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    direction: rtl;
}

.footer-section .copyright {
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section .content-desc {
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.footer-section .contact-desc {
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.footer-section .email {
    color: #06b6d4;
    font-weight: 500;
    margin: 0.5rem 0 1.5rem;
    font-size: 1rem;
}

.footer-section .developer {
    color: #8b5cf6;
    font-weight: 500;
    margin-top: 1.5rem;
    font-size: 1rem;
}

/* References Page Styles */
#references-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 30%, #312e81 70%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.references-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.references-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.references-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.references-subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

.references-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.references-section {
    background: rgba(30, 58, 138, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    padding: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reference-item {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.reference-item:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.5);
    transform: translateY(-2px);
}

.reference-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.reference-item h3 a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.reference-item h3 a:hover {
    color: #06b6d4;
    text-decoration: underline;
}

.reference-item .authors {
    color: #8b5cf6;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.reference-item .details {
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* 🟢 کدهای اصلاح‌شده برای references-disclaimer در این بخش قرار گرفته‌اند. */
.references-disclaimer {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.references-disclaimer:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.5);
    transform: translateY(-2px);
}

.disclaimer-content h3 {
    color: #8b5cf6;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.disclaimer-content p {
    color: #cbd5e1;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* References Card Styles - Special positioning */
.references-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.15));
    border: 3px solid rgba(34, 197, 94, 0.4);
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 2rem auto 0;
    transform: scale(1.05);
}

.references-card:hover {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 30px 60px rgba(34, 197, 94, 0.4);
    transform: scale(1.08) translateY(-5px);
}

.references-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    margin-bottom: 1rem;
}

.references-icon {
    color: #8b5cf6;
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

/* Video Page Improvements */
.video-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.video-main-title {
    font-size: 2rem;
    font-weight: 700;
    color: #38bdf8;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.video-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button order: Aparat - YouTube - Download */
.primary-btn {
    order: 1;
}

.secondary-btn {
    order: 2;
}

.download-btn {
    order: 3;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 180px;
    justify-content: center;
}

.primary-btn {
    background: linear-gradient(135deg, #df0f50, #c40e47);
    color: white;
    border-color: rgba(223, 15, 80, 0.5);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #c40e47, #a50c3a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(223, 15, 80, 0.4);
}

.secondary-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: rgba(239, 68, 68, 0.5);
}

.secondary-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: rgba(16, 185, 129, 0.5);
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Improved Responsive Navigation */
.video-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Enhanced View Button */
.view-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #38bdf8;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
}

.view-button:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

/* Chapter dropdown styles */
.chapters-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding-right: 1.5rem;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-arrow {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.chapters-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Video page navigation styles - completely rewritten */
.video-nav {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 10px;
    color: #38bdf8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.2);
}

.chapters-btn.active {
    background: rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.5);
}

/* Dropdown menu - fixed implementation */
.chapters-dropdown {
    position: relative;
}

#chapters-dropdown-menu,
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    min-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    direction: rtl;
    text-align: right;
}

.dropdown-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding-right: 2rem;
}

.dropdown-item.current {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-weight: 500;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-arrow {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.chapters-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-logo {
        order: -1;
        margin-bottom: 1rem;
    }

    .footer-section {
        text-align: center;
    }

    .references-title {
        font-size: 2rem;
    }

    .video-main-title {
        font-size: 1.5rem;
    }

    .video-actions {
        flex-direction: column;
        align-items: center;
        padding-right: 0;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .video-nav {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .references-container {
        padding: 1rem;
    }

    .references-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .video-content {
        padding: 1rem;
    }

    .video-main-title {
        font-size: 1.5rem;
    }
}
.nav-btn, .nav-btn * {
    font-family: 'Vazirmatn', sans-serif !important;
    font-weight: 500;
}
/* =================================================================== */
/* Dropdown Final Solution - With Hidden Scrollbar                     */
/* =================================================================== */

/* والد منو باید این خاصیت را داشته باشد */
.chapters-dropdown {
    position: relative;
}

#chapters-dropdown-menu,
.dropdown-menu {
    /* ۱. منطق موقعیت‌یابی */
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;

    /* ۲. رفتار داخلی */
    direction: rtl;

    /* ۳. کنترل پهنا و ارتفاع */
    width: 320px;
    max-height: 400px;
    overflow-y: auto;

    /* ۴. مخفی کردن اسکرول‌بار برای فایرفاکس */
    scrollbar-width: none;

    /* سایر استایل‌های ظاهری */
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ۵. مخفی کردن اسکرول‌بار برای کروم، سافاری و مرورگرهای مشابه */
#chapters-dropdown-menu::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar {
    display: none;
}
/* استایل لوگوی وسط نوار نویگیشن */
.nav-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo {
    height: 120px;
    width: auto;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}
/* ============================================== */
/* کدهای جدید برای ریسپانسیو کردن گرید کارت‌ها */
/* ============================================== */

/* حالت پیش‌فرض برای دسکتاپ (۳ ستونه) بدون تغییر باقی می‌ماند */
/* .chapters-grid { grid-template-columns: repeat(3, 1fr); } */


/* برای تبلت و صفحات نمایش متوسط (مثلا تا عرض 1024 پیکسل) */
@media (max-width: 1024px) {
    .chapters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    /* چیدمان پیوست‌ها و منابع برای حالت تبلت */
    .chapter-card[data-chapter="10"] {
        grid-column: auto;
    }
    .chapter-card[data-chapter="appendixA"] {
        grid-column: 1 / span 1;
    }
    .chapter-card[data-chapter="appendixB"] {
        grid-column: 2 / span 1;
    }
    .references-card {
        grid-column: 1 / span 2 !important;
    }
}

/* برای موبایل و صفحات نمایش کوچک (مثلا تا عرض 768 پیکسل) */
/* این کد جایگزین کد قبلی شما برای این سایز می‌شود */
@media (max-width: 768px) {
    .chapters-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    /* در حالت موبایل، چیدمان خاص برخی کارت‌ها را حذف می‌کنیم تا همه زیر هم باشند */
    .chapter-card[data-chapter="10"],
    .chapter-card[data-chapter="appendixA"],
    .chapter-card[data-chapter="appendixB"],
    .references-card {
        grid-column: auto !important;
        margin-top: 0;
    }

}
.chapter-card:nth-child(10) {
    grid-column: auto;
}
/* ============================================== */
/* اصلاح اندازه لوگو در حالت موبایل      */
/* ============================================== */

@media (max-width: 768px) {
    .nav-logo {
        height: 70px;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .video-nav {
        padding: 1rem;
    }
}
/* ============================================== */
/* اصلاح موقعیت منوی کشویی در حالت موبایل      */
/* ============================================== */
@media (max-width: 768px) {
    .chapters-dropdown {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #chapters-dropdown-menu,
    .dropdown-menu {
        position: absolute;
        left: 50%;
        right: auto;
        transform: translateX(-50%);

        width: 90vw;
        max-width: 350px;
    }


    /* ... سایر کدهای شما در این مدیا کوئری ... */
}