/* ===== Lesson Player Styles ===== */

.lesson-player {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.lesson-player .lesson-header {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.lesson-player .lesson-header h1 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

/* Tabs */
.lesson-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lesson-tab {
    padding: 12px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.lesson-tab:hover {
    background: var(--bg-dark-lighter);
    color: var(--text-primary);
}

.lesson-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Content Area */
.lesson-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.section-header {
    margin-bottom: 20px;
}

.section-type {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-title {
    margin: 10px 0;
    color: var(--text-primary);
}

.section-instruction {
    background: var(--bg-dark-lighter);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

/* Audio Player */
.audio-player-container {
    margin: 30px 0;
}

.audio-player {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-dark-lighter);
}

.btn-audio-control {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-audio-control:hover {
    background: var(--primary-dark);
}

.audio-timeline {
    flex: 1;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s;
}

.audio-time {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-control input[type="range"] {
    width: 80px;
    accent-color: var(--primary);
}

.audio-subtitles {
    padding: 20px;
    background: var(--bg-dark);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-top: 1px solid var(--border);
}

.subtitle-text {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Exercise Styles */
.exercise {
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-dark-lighter);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.exercise-header {
    margin-bottom: 20px;
}

.exercise-id {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.exercise-instruction {
    color: var(--text-secondary);
    font-size: 14px;
}

.question {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.question-number {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.question-text {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.option-label:hover {
    background: var(--bg-dark-lighter);
}

.option-label input[type="radio"] {
    accent-color: var(--primary);
}

.answer-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 15px;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary);
}

.words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.word-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.word-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.word-btn.selected {
    opacity: 0.5;
    cursor: not-allowed;
}

.word-btn:disabled {
    cursor: not-allowed;
}

.answer-words {
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-weight: 600;
    min-height: 40px;
}

/* Feedback Styles */
.question-feedback {
    margin-top: 12px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.question-feedback.correct {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.question-feedback.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.exercise-feedback {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-check {
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-check:hover {
    background: var(--primary-dark);
}

/* Footer Navigation */
.lesson-footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.btn-nav {
    flex: 1;
    padding: 15px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: var(--bg-dark-lighter);
    border-color: var(--primary);
}

.btn-nav.btn-next {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-nav.btn-next:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-player {
        padding: 15px;
    }

    .audio-controls {
        flex-wrap: wrap;
    }

    .lesson-tabs {
        flex-direction: column;
    }

    .lesson-tab {
        width: 100%;
    }
}

/* ===== Drag and Drop Words Exercise ===== */

.words-source-container,
.words-answer-container {
    margin: 20px 0;
}

.words-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.words-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 60px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-md);
    border: 2px solid #dee2e6;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.word-box {
    padding: 12px 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 8px;
    cursor: grab;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    text-align: center;
    position: relative;
}

.word-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    border-width: 3px;
}

.word-box.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.word-box:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Порядковый номер слова в ответе */
.word-box::before {
    counter-increment: word-counter;
    content: counter(word-counter);
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.words-answer-area .word-box::before {
    opacity: 1;
}

.words-answer-area {
    counter-reset: word-counter;
}

.words-answer-area {
    min-height: 100px;
    padding: 20px;
    background: var(--bg-dark);
    border: 3px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.words-answer-area:empty::before {
    content: '👆 Перетащите слова сюда';
    color: var(--text-muted);
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.words-answer-area.drag-over {
    border-color: var(--primary);
    border-style: solid;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: scale(1.01);
}

.words-answer-area.correct {
    border-color: #10b981;
    border-style: solid;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.words-answer-area.correct::after {
    content: '✓ Правильно!';
    position: absolute;
    bottom: -25px;
    right: 10px;
    color: #10b981;
    font-weight: bold;
    font-size: 14px;
}

.words-answer-area.incorrect {
    border-color: #ef4444;
    border-style: solid;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.words-answer-area.incorrect::after {
    content: '✗ Попробуйте еще раз';
    position: absolute;
    bottom: -25px;
    right: 10px;
    color: #ef4444;
    font-weight: bold;
    font-size: 14px;
}

.btn-clear-words {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-clear-words:hover {
    background: var(--bg-dark-lighter);
    border-color: var(--primary);
    color: var(--primary);
}

.words-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Анимации для слов */
@keyframes wordPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.word-box {
    animation: wordPop 0.3s ease-out;
}
