/* Enhanced Lecture Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.lecture-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 20px 40px;
    text-align: center;
}

.lecture-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.lecture-badge.intermediate {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.lecture-hero h1 {
    font-size: 42px;
    margin: 15px 0;
    font-weight: 700;
}

.lecture-subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin: 15px 0 25px;
}

.lecture-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.lecture-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Study Mode Toggle */
.study-mode-toggle {
    background: white;
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.5s ease;
}

/* Tabs */
.lecture-content-enhanced {
    padding: 40px 20px;
    background: var(--bg-light);
}

.lecture-content-enhanced .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.tabs-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    background: #f3f4f6;
    padding: 8px;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: white;
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tabs-content {
    padding: 40px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Intro */
.section-intro {
    margin-bottom: 35px;
}

.section-intro h2 {
    color: var(--text-dark);
    font-size: 32px;
    margin-bottom: 12px;
}

.section-intro p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
}

/* Phrase Cards */
.phrase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.phrase-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
    position: relative;
}

.phrase-card.interactive {
    cursor: pointer;
}

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

.phrase-card.speaking {
    animation: pulse 0.5s ease;
    border-color: var(--primary-color);
}

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

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

.phrase-number {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.phrase-audio-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
}

.phrase-audio-btn:hover {
    transform: scale(1.2);
    color: var(--secondary-color);
}

.phrase-vietnamese {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.phrase-pronunciation {
    font-size: 15px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 12px;
}

.phrase-english {
    font-size: 16px;
    color: var(--text-dark);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.phrase-grammar,
.phrase-note {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
}

/* Word Breakdown */
.phrase-breakdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.word-part {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.word-part.subject {
    background: #dbeafe;
    color: #1e40af;
}

.word-part.verb {
    background: #dcfce7;
    color: #15803d;
}

.word-part.object {
    background: #fef3c7;
    color: #92400e;
}

.word-part.noun {
    background: #e0e7ff;
    color: #4338ca;
}

.word-part.adjective {
    background: #fce7f3;
    color: #9f1239;
}

.word-part.classifier {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Subsections */
.subsection {
    margin: 40px 0;
}

.subsection h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-desc {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Question Words Grid */
.question-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.question-word-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.question-word-card:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.qw-vietnamese {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.qw-english {
    font-size: 14px;
    opacity: 0.9;
}

/* Comparison Box */
.comparison-box {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
}

.comparison-side {
    text-align: center;
}

.comparison-side h4 {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.comparison-side.positive h4 {
    color: var(--success-color);
}

.comparison-side.negative h4 {
    color: var(--error-color);
}

.comparison-phrase {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.comparison-meaning {
    font-size: 15px;
    color: var(--text-light);
}

.comparison-note {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
}

.comparison-arrow {
    font-size: 28px;
    color: var(--primary-color);
}

.highlight-adj {
    color: var(--primary-color);
}

/* Classifiers Grid */
.classifiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.classifier-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

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

.classifier-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.classifier-word {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.classifier-use {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.classifier-example {
    font-size: 13px;
    color: var(--text-dark);
    font-style: italic;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Tip Card */
.tip-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.tip-card i {
    font-size: 24px;
    color: #d97706;
    flex-shrink: 0;
}

.tip-card strong {
    color: #92400e;
}

/* Practice Exercises */
.exercise-section {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
}

.exercise-section h3 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sentence Builder */
.sentence-builder {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

.target-english {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.drop-zone {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    min-height: 60px;
}

.drop-slot {
    width: 120px;
    height: 60px;
    border: 3px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.drop-slot.drag-over {
    border-color: var(--primary-color);
    background: #ede9fe;
}

.word-bank {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.word-tile {
    padding: 15px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: move;
    transition: all 0.3s;
    user-select: none;
}

.word-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.word-tile.dragging {
    opacity: 0.5;
}

.btn-check {
    display: block;
    margin: 20px auto 0;
    padding: 12px 30px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-check:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Fill in the Blank */
.fill-blank-exercise {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

.fb-question {
    font-size: 16px;
    line-height: 1.8;
}

.fb-input {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    min-width: 150px;
    transition: all 0.3s;
}

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

.fb-input.correct {
    border-color: var(--success-color);
    background: #d1fae5;
}

.fb-input.incorrect {
    border-color: var(--error-color);
    background: #fee2e2;
}

.fb-hint {
    font-size: 14px;
    color: var(--text-light);
    font-style: italic;
    margin: 10px 0;
}

.btn-check-small {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin: 15px 0;
    transition: all 0.3s;
}

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

.fb-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
}

.fb-feedback.correct {
    background: #d1fae5;
    color: #065f46;
}

.fb-feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

/* Matching Game */
.matching-game {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.match-card {
    padding: 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.match-card.selected {
    border-color: var(--primary-color);
    background: #ede9fe;
}

.match-card.matched {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    pointer-events: none;
}

/* Sidebar */
.enhanced-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.sidebar-card h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Progress Circle */
.progress-card {
    text-align: center;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.progress-bar-circle {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 282.7;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-complete {
    width: 100%;
    padding: 14px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.btn-complete:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Quick Reference */
.quick-ref-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-ref-item {
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.quick-ref-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 4px;
}

/* Related Lessons */
.related-lessons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-lesson-link {
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-lesson-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.related-lesson-link i {
    color: var(--primary-color);
}

.related-lesson-link:hover i {
    color: white;
}

/* Feedback Toast */
.feedback-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.feedback-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.feedback-toast.success {
    background: var(--success-color);
    color: white;
}

.feedback-toast.error {
    background: var(--error-color);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .lecture-content-enhanced .container {
        grid-template-columns: 1fr;
    }
    
    .enhanced-sidebar {
        order: -1;
    }
    
    .tabs-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .lecture-hero h1 {
        font-size: 32px;
    }
    
    .tabs-content {
        padding: 20px;
    }
    
    .phrase-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-box {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
    
    .classifiers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .phrase-vietnamese {
        font-size: 20px;
    }
    
    .drop-zone {
        flex-direction: column;
        align-items: center;
    }
    
    .drop-slot {
        width: 100%;
        max-width: 200px;
    }
    
    .classifiers-grid {
        grid-template-columns: 1fr;
    }
}
