/* Modern, responsive CSS for CEFR Reading Test */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-accent: #f3f4f6;
    --border-color: #e5e7eb;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.15s ease-in-out;
}

/* Dark theme */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-accent: #374151;
    --border-color: #4b5563;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: var(--transition);
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Placement test info */
.placement-info {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.placement-info h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.placement-info .info-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
}

.placement-info .info-list {
    text-align: left;
    margin: 1rem 0;
}

.placement-info .info-list li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Placement complete */
.placement-complete {
    background: linear-gradient(135deg, var(--success-color), #22c55e);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.placement-complete h3 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.placement-complete .assigned-level {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    backdrop-filter: blur(10px);
}

.placement-complete .level-badge {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.placement-complete .level-description {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.placement-complete .summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.placement-complete .stat-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
}

.placement-complete .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.placement-complete .stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Level selector */
.level-selector {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.level-selector h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.level-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.level-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.level-card.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.level-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.level-card p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Test area */
.test-area {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    background: var(--bg-accent);
    border-radius: 999px;
    height: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    height: 100%;
    transition: width 0.3s ease-in-out;
    border-radius: 999px;
}

.sentence-display {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sentence-display.recording {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.sentence-text {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

.sentence-info {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-accent);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

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

.btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-accent);
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-error {
    background: var(--error-color);
}

/* Recording indicator */
.recording-indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--error-color);
    font-weight: 500;
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--error-color);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Timer */
.timer {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin: 1rem 0;
}

.timer.recording {
    color: var(--error-color);
}

/* Results */
.results {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    display: none;
}

.results.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

.grade-display {
    text-align: center;
    margin-bottom: 2rem;
}

.grade-badge {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.grade-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.grade-description {
    color: var(--text-secondary);
    margin: 0;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.score-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.feedback {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.feedback h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.feedback ul {
    margin: 0;
    padding-left: 1.5rem;
}

.feedback li {
    margin-bottom: 0.5rem;
}

/* Exemplar Audio Controls */
.exemplar-controls {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(16, 185, 129, 0.05));
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    text-align: center;
}

.exemplar-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.exemplar-header p {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.exemplar-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.quality-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.quality-badge.recorded {
    background: var(--success-color);
    color: white;
}

.quality-badge.synthetic {
    background: var(--warning-color);
    color: white;
}

/* Comparison Results */
.comparison-results {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 1rem 0;
}

.comparison-results h3 {
    margin: 0 0 1.5rem 0;
    text-align: center;
    color: var(--primary-color);
}

.exemplar-info {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.exemplar-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.comparison-metrics {
    margin-bottom: 1.5rem;
}

.comparison-metrics h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-value.overall {
    font-size: 2rem;
    color: var(--success-color);
}

.recommendations {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.recommendations h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.recommendations ul {
    margin: 0;
    padding-left: 1.5rem;
}

.recommendations li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Audio playback */
.audio-playback {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    display: none;
}

.audio-playback.show {
    display: block;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* History and progress */
.history-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.history-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.history-item:last-child {
    margin-bottom: 0;
}

/* Custom text upload */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* Loading states */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-accent);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.btn:focus,
.level-card:focus,
.upload-area:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .sentence-text {
        font-size: 1.25rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
    }
    
    .scores-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sentence-display {
        padding: 1rem;
        min-height: 80px;
    }
    
    .sentence-info {
        position: static;
        margin-top: 1rem;
        text-align: center;
    }
    
    .test-area,
    .level-selector {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .controls,
    .upload-area,
    .audio-playback {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    .btn {
        border: 2px solid transparent;
    }
    
    .btn:focus {
        border-color: #000000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================
   NAVIGATION STYLES
   ======================== */

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.nav-action-btn:hover {
    background: var(--bg-accent);
}

/* ========================
   ANALYTICS DASHBOARD STYLES
   ======================== */

.analytics-dashboard {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.analytics-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.analytics-header h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.analytics-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    font-weight: 500;
}

.tab-button:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.analytics-content {
    position: relative;
}

.tab-panel {
    display: none;
    padding: 2rem;
}

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

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================
   PRONUNCIATION EXERCISES STYLES
   ======================== */

.pronunciation-exercises {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid var(--warning-color);
}

.pronunciation-exercises h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-summary {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.exercise-summary.excellent {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
    border: 1px solid var(--success-color);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.recommendation {
    background: var(--bg-accent);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary-color);
}

.recommendation p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.priority-areas {
    background: var(--bg-accent);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.priority-areas h5 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.priority-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.priority-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.priority-sound {
    font-weight: 600;
    color: var(--primary-color);
    font-family: monospace;
}

.priority-severity {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

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

.exercise-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.exercise-header {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.exercise-header h5 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.exercise-category {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.exercise-category.segmental {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.exercise-category.suprasegmental {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.exercise-category.clarity {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.exercise-time,
.exercise-priority {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.exercise-priority.priority-8,
.exercise-priority.priority-9,
.exercise-priority.priority-10 {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.exercise-priority.priority-5,
.exercise-priority.priority-6,
.exercise-priority.priority-7 {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.exercise-content {
    padding: 1.5rem;
}

.exercise-instructions {
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
}

.minimal-pairs,
.isolation-practice,
.sentence-practice,
.articulation-practice,
.generic-exercises {
    margin-bottom: 1rem;
}

.minimal-pairs h6,
.isolation-practice h6,
.sentence-practice h6,
.articulation-practice h6 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pairs-grid {
    display: grid;
    gap: 0.75rem;
}

.pair-item {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.target-word,
.contrast-word {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: monospace;
}

.target-word {
    color: var(--success-color);
}

.contrast-word {
    color: var(--error-color);
}

.vs {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.focus-note {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.practice-word {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: monospace;
    color: var(--primary-color);
    transition: var(--transition);
    cursor: pointer;
}

.practice-word:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.sentence-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.practice-sentence {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-left: 3px solid var(--primary-color);
    font-style: italic;
}

.generic-exercises {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.generic-exercise {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.exercise-actions {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

.start-exercise {
    background: var(--success-color);
}

.start-exercise:hover {
    background: #059669;
}

.mark-complete {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.mark-complete:hover {
    background: var(--bg-accent);
    border-color: var(--success-color);
}

.next-session {
    background: var(--bg-primary);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.next-session h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.next-session p {
    margin: 0;
    color: var(--text-secondary);
}

/* Mobile responsive adjustments for exercises */
@media (max-width: 768px) {
    .exercise-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .pair-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }
    
    .vs {
        order: 2;
    }
    
    .focus-note {
        order: 3;
        grid-column: auto;
        margin-top: 0.5rem;
    }
    
    .exercise-actions {
        flex-direction: column;
    }
    
    .pronunciation-exercises {
        padding: 1rem;
    }
}ontent: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.metric-trend.positive {
    color: var(--success-color);
}

.metric-trend.negative {
    color: var(--error-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.skill-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.skill-score {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--bg-accent);
}

.skill-score.excellent {
    background: var(--success-color);
    color: white;
}

.skill-score.good {
    background: #22c55e;
    color: white;
}

.skill-score.fair {
    background: var(--warning-color);
    color: white;
}

.skill-score.needs-improvement {
    background: var(--error-color);
    color: white;
}

.skill-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-value.positive {
    color: var(--success-color);
}

.stat-value.negative {
    color: var(--error-color);
}

.stat-value.neutral {
    color: var(--text-secondary);
}

.skill-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-accent);
    border-radius: 4px;
    overflow: hidden;
}

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

.skill-advice {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    background: var(--bg-primary);
}

.insight-item.positive {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.insight-item.improvement {
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.05);
}

.insight-item.achievement {
    border-left-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.insight-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    flex: 1;
}

.confidence-badge {
    font-size: 0.75rem;
    background: var(--bg-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    color: var(--text-secondary);
}

.insight-message {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.recommendation-item.priority-high {
    border-left: 4px solid var(--error-color);
}

.recommendation-item.priority-medium {
    border-left: 4px solid var(--warning-color);
}

.recommendation-item.priority-low {
    border-left: 4px solid var(--text-secondary);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.recommendation-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.priority-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.priority-badge.high {
    background: var(--error-color);
    color: white;
}

.priority-badge.medium {
    background: var(--warning-color);
    color: white;
}

.priority-badge.low {
    background: var(--text-secondary);
    color: white;
}

.recommendation-description {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.action-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    background: var(--primary-dark);
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-message {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.level-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: var(--bg-accent);
}

.level-badge.a1,
.level-badge.a2 {
    background: #dbeafe;
    color: #1e40af;
}

.level-badge.b1,
.level-badge.b2 {
    background: #fef3c7;
    color: #92400e;
}

.level-badge.c1,
.level-badge.c2 {
    background: #dcfce7;
    color: #166534;
}

.mastery-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.mastery-badge.mastered {
    background: var(--success-color);
    color: white;
}

.mastery-badge.proficient {
    background: var(--warning-color);
    color: white;
}

.mastery-badge.developing {
    background: var(--text-secondary);
    color: white;
}

.level-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.milestone-item.achieved {
    opacity: 0.7;
}

.milestone-icon {
    font-size: 1.25rem;
}

.milestone-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.milestone-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Mobile responsiveness for analytics */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .analytics-header {
        padding: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .analytics-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .analytics-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .tab-panel {
        padding: 1rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Phonetic Analysis Styles */
.phonetic-analysis {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(160, 82, 45, 0.05));
    border: 1px solid #d2b48c;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.phonetic-analysis h4 {
    color: #8b4513;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.phonetic-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.phonetic-score-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

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

.phonetic-score-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem auto;
    font-weight: bold;
    color: white;
    font-size: 0.85rem;
}

.score-circle.excellent {
    background: linear-gradient(135deg, #10b981, #059669);
}

.score-circle.good {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.score-circle.fair {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.score-circle.needs-work {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.phonetic-score-card p {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.phonetic-feedback {
    margin-top: 1.5rem;
}

.feedback-section {
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.feedback-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-section.strengths h5 {
    color: var(--success-color);
}

.feedback-section.improvements h5 {
    color: var(--warning-color);
}

.feedback-section.tips h5 {
    color: var(--primary-color);
}

.feedback-section.level-specific h5 {
    color: #8b4513;
}

.feedback-section ul {
    margin: 0;
    padding-left: 1.2rem;
}

.feedback-section li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.feedback-section li:last-child {
    margin-bottom: 0;
}

/* Responsive phonetic analysis */
@media (max-width: 768px) {
    .phonetic-score-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .score-circle {
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
    
    .phonetic-analysis {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .feedback-section {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .phonetic-score-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================
   VISUAL PHONETIC ANALYSIS STYLES
   ======================== */

.visual-analysis {
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
}

.visual-analysis h4 {
    margin: 0;
    padding: 1rem;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.visualization-tabs {
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-color);
}

.visualization-content {
    position: relative;
    min-height: 300px;
}

.viz-panel {
    display: none;
    padding: 1.5rem;
    background: var(--bg-primary);
}

.viz-panel.active {
    display: block;
}

.viz-panel canvas {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Waveform comparison layout */
.waveform-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.waveform-section h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
}

.color-box.user {
    background-color: #007bff;
}

.color-box.target {
    background-color: #28a745;
}

.color-box.exemplar {
    background-color: #28a745;
}

.viz-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: calc(var(--border-radius) - 1px);
}

.spectrogram-legend {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.frequency-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.intensity-scale {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scale-bar {
    width: 100px;
    height: 8px;
    background: linear-gradient(to right, 
        #440154, #482777, #3f4a8a, #31678e, 
        #26838f, #1f9d8a, #6cce5a, #b6de2b, #fee825);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.scale-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.formant-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.formant-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.formant-values p {
    margin: 0;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.formant-values span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Visualization loading states */
.viz-panel.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
}

.viz-panel.loading::before {
    content: "⏳ Generating visualization...";
    font-size: 1rem;
}

/* Error states */
.viz-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-secondary);
    text-align: center;
}

.viz-error h5 {
    margin: 0 0 0.5rem;
    color: var(--danger-color);
}

.viz-error p {
    margin: 0;
    font-size: 0.875rem;
}

/* Responsive design for visualizations */
@media (max-width: 768px) {
    .visualization-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab-btn:last-child {
        border-bottom: none;
    }
    
    .viz-panel {
        padding: 1rem;
    }
    
    .viz-panel canvas {
        max-width: 100%;
        height: auto;
    }
    
    .legend {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .formant-values {
        grid-template-columns: 1fr;
    }
    
    .frequency-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .viz-panel canvas {
        width: 100%;
        max-width: 300px;
        height: 150px;
    }
    
    .intensity-scale {
        flex-direction: column;
    }
    
    .viz-controls {
        flex-direction: column;
        width: 100%;
    }
}

/* === PRACTICE PAGE STYLES === */

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

.practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.practice-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.exercise-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.exercise-type {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
}

.exercise-level {
    background: var(--bg-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.practice-content {
    display: grid;
    gap: 2rem;
}

.exercise-details {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.exercise-details h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.exercise-details .instructions {
    margin: 0;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

.practice-sections {
    display: grid;
    gap: 1.5rem;
}

.practice-section {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.practice-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.minimal-pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.pair-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-weight: 600;
}

.word-a, .word-b {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.vs {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.isolation-words, .articulation-exercises {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.practice-word {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
}

.practice-sentences {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.practice-sentence {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--success-color);
    font-style: italic;
    line-height: 1.6;
}

.practice-tip {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.practice-controls {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.recording-section {
    margin-bottom: 2rem;
}

.recording-section .btn {
    margin: 0 0.5rem;
}

.practice-waveform {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.practice-waveform canvas {
    border-radius: var(--border-radius);
    background: white;
}

.practice-feedback {
    text-align: left;
    margin-bottom: 2rem;
}

.practice-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

/* Practice page responsive design */
@media (max-width: 768px) {
    .practice-page {
        padding: 1rem;
    }
    
    .practice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .exercise-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .minimal-pairs-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-navigation {
        flex-direction: column;
    }
    
    .recording-section .btn {
        display: block;
        margin: 0.5rem 0;
        width: 100%;
    }
    
    .practice-waveform canvas {
        width: 100%;
        height: 120px;
    }
}