/* Base Layout */
.language-tutor-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    font-family: system-ui, -apple-system, sans-serif;
    color: #1f2937;
    background: #f8fafc;
    min-height: 100vh;
    position: relative;
}

/* Lesson Content */
.lesson-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Headers */
.lesson-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 1rem;
}

.language-name {
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Dialogue Section */
.dialogue-section {
    margin: 2rem 0;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.dialogue-exchange {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dialogue-exchange:hover {
    transform: translateX(0.25rem);
}

.speaker-line {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.speaker {
    font-weight: 600;
    color: #2563eb;
    min-width: 80px;
    margin-right: 1rem;
}

.text {
    color: #1f2937;
    font-size: 1.125rem;
    line-height: 1.5;
}

.translation {
    color: #4b5563;
    margin-left: 90px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.pronunciation {
    color: #6b7280;
    margin-left: 90px;
    font-size: 0.875rem;
    font-style: italic;
}

/* Key Expressions */
.key-expressions {
    background: #f0f9ff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.key-expressions h3 {
    color: #0369a1;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.key-phrase {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.phrase-text {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.phrase-translation {
    color: #4b5563;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.phrase-usage {
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

/* Practice Section */
.practice-section {
    background: #f0fdf4;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.practice-section h3 {
    color: #166534;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.practice-exercise {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.question-text {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.quiz-options {
    display: grid;
    gap: 0.75rem;
}

.quiz-option {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.quiz-option[data-correct="true"].selected {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.quiz-option[data-correct="false"].selected {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .language-tutor-container {
        padding: 1rem;
    }

    .lesson-content {
        padding: 1.5rem;
    }

    .lesson-title {
        font-size: 1.875rem;
    }

    .language-name {
        font-size: 1.25rem;
        display: block;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .speaker-line {
        flex-direction: column;
    }

    .translation,
    .pronunciation {
        margin-left: 0;
    }
}

/* Interactive Elements */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 10;
}

.tooltip-trigger:hover .tooltip-content {
    display: block;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    cursor: pointer;
}

.section-toggle {
    width: 24px;
    height: 24px;
    position: relative;
}

.section-toggle::before,
.section-toggle::after {
    content: '';
    position: absolute;
    background: #4b5563;
    transition: transform 0.2s;
}

.section-toggle::before {
    width: 2px;
    height: 12px;
    left: 11px;
    top: 6px;
}

.section-toggle::after {
    width: 12px;
    height: 2px;
    left: 6px;
    top: 11px;
}

.expanded .section-toggle::before {
    transform: rotate(90deg);
}

.section-content {
    display: none;
    padding: 1rem;
}

.section-content.expanded {
    display: block;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.375rem;
}

.error-message svg {
    color: #ef4444;
}

.error-message p {
    color: #991b1b;
    margin: 0;
}