* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #0f0f0f 100%);
    min-height: 100vh;
    color: #fff;
    /* --- تغییر اصلی و نهایی اینجاست --- */
    /* به جای وسط‌چینی، فقط یک فاصله مناسب از بالا و پایین می‌دهیم */
    /* این تضمین می‌کند که محتوا همیشه از بالا شروع می‌شود */
    padding: 50px 15px;
}

.container {
    max-width: 900px;
    /* margin: 0 auto; به تنهایی برای وسط‌چینی افقی کافی است */
    margin: 0 auto;
    /* padding: 0 20px; دیگر لازم نیست چون به body منتقل شد */
    margin-top: 5rem !important; /* یک فاصله مناسب از بالا ایجاد می‌کند */
    margin-bottom: 5rem !important; /* یک فاصله مناسب از پایین هم برای زیبایی بیشتر */

}

.quiz-container {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    padding: 40px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
}

.quiz-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #ffd700;
}

.quiz-title {
    color: #ffd700;
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.content-type-badge {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 25px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.progress-bar-container {
    background: rgba(51, 51, 51, 0.8);
    border-radius: 15px;
    height: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #ffd700;
}

.progress-bar {
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    height: 100%;
    width: 0%;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.progress-text {
    text-align: center;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 20px;
}

.question-card {
    background: rgba(17, 17, 17, 0.9);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    border: 2px solid #333;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.question-card.active {
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.question-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 20px;
}

.question-number {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.6;
    flex: 1;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option-btn {
    width: 100%;
    text-align: right;
    padding: 18px 25px;
    border: 2px solid #444;
    background: rgba(40, 40, 40, 0.8);
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.6s;
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.option-btn.selected {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    border-color: #ffd700;
    font-weight: bold;
}

.option-btn.correct {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

.option-btn.incorrect {
    background: linear-gradient(45deg, #dc3545, #e74c3c) !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.navigation-area {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
}

.submit-btn:hover {
    background: linear-gradient(45deg, #ffed4e, #fff200);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.4);
}

.next-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: #fff;
}

.next-btn:hover {
    background: linear-gradient(45deg, #20c997, #17a2b8);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(40, 167, 69, 0.4);
}

.result-card {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    color: #fff;
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    margin-top: 40px;
    border: 3px solid #ffd700;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #000;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-title {
    font-size: 2.2rem;
    color: #ffd700;
    margin-bottom: 20px;
}

.result-summary {
    font-size: 1.3rem;
    margin-bottom: 40px;
    line-height: 1.8;
}

.answers-review {
    text-align: right;
    margin-top: 40px;
}

.review-title {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
}

.review-item {
    background: rgba(40, 40, 40, 0.6);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-right: 5px solid #ffd700;
}

.review-question {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.review-your-answer,
.review-correct-answer {
    margin-bottom: 8px;
    font-size: 1rem;
}

.review-your-answer.correct {
    color: #28a745;
}

.review-your-answer.incorrect {
    color: #dc3545;
}

.review-correct-answer {
    color: #28a745;
}

.restart-btn {
    background: linear-gradient(45deg, #6f42c1, #8e44ad);
    color: #fff;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.restart-btn:hover {
    background: linear-gradient(45deg, #8e44ad, #9c27b0);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(142, 68, 173, 0.4);
}

.loading-spinner {
    text-align: center;
    padding: 80px;
    color: #ffd700;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 215, 0, 0.3);
    border-top: 6px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: rgba(26, 26, 26, 0.9);
    color: #ffd700;
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        padding: 25px;
        margin: 10px;
    }
    
    .quiz-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .question-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .question-number {
        align-self: center;
    }
    
    .question-text {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .option-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .navigation-area {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
        font-size: 2rem;
    }
    
    .result-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    body {
        /* در موبایل فاصله کمتری می‌دهیم */
        padding: 20px 10px;
    }

    .container {
        padding: 0;
    }
    
    .quiz-container {
        padding: 20px;
    }
    
    .quiz-title {
        font-size: 1.8rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .result-title {
        font-size: 1.8rem;
    }
    
    .result-summary {
        font-size: 1.1rem;
    }
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.video-transcript-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.video-section {
    flex: 2;
}

.transcript-section {
    flex: 1;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.transcript-header {
    background: #2a2a2a;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #666 #2a2a2a;
}

.transcript-content::-webkit-scrollbar {
    width: 6px;
}

.transcript-content::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.transcript-item {
    padding: 12px 20px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.transcript-item:hover {
    background: #2a2a2a;
}

.transcript-item.current {
    background: #1565c0;
    border-left: 4px solid #42a5f5;
}

.transcript-item.current .transcript-text {
    font-weight: 600;
}

.transcript-time {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.transcript-text {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 14px;
}

.transcript-word {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s ease;
    position: relative;
}

.transcript-word:hover {
    background: rgba(76, 175, 80, 0.4) !important;
    transform: scale(1.05);
}

.transcript-word:active {
    transform: scale(0.95);
    background: rgba(76, 175, 80, 0.6) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .video-transcript-container {
        flex-direction: column;
    }
    
    .transcript-section {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .transcript-item {
        padding: 10px 15px;
    }
    
    .transcript-text {
        font-size: 13px;
    }
}