:root {
    --color-bg: #0a0f1c;
    --color-surface: #1a1f35;
    --color-primary: #00d4aa;
    --color-secondary: #ff6b9d;
    --color-accent: #7c5cff;
    --color-text: #e0e7ff;
    --color-text-muted: #9ca3af;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Grid Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Header - Mobile First */
header {
    position: relative;
    padding: 0.75rem 1rem;
    background: rgba(26, 31, 53, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

header > div {
    flex-wrap: wrap;
    gap: 0.5rem !important;
}

header .btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.75rem;
}

header span {
    font-size: 0.8rem;
}

@media (min-width: 600px) {
    header {
        padding: 1rem 1.5rem;
        flex-wrap: nowrap;
    }

    header .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem;
    }

    header span {
        font-size: 0.9rem;
    }
}

@media (min-width: 900px) {
    header {
        padding: 1.5rem 2rem;
    }

    header .btn {
        font-size: 1rem;
    }

    header span {
        font-size: 1rem;
    }
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 600px) {
    .logo {
        font-size: 1.3rem;
    }
}

@media (min-width: 900px) {
    .logo {
        font-size: 1.5rem;
    }
}

.badge {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(124, 92, 255, 0.2));
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    position: relative;
    text-align: center;
    padding: 3rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* App Container */
.app-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.teacher-grid {
    display: grid;
    gap: 1rem;
}

.teacher-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.teacher-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 170, 0.2);
}

.teacher-card.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
}

.teacher-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.teacher-info {
    flex: 1;
}

.teacher-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.teacher-info p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.teacher-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.teacher-accent {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    background: rgba(124, 92, 255, 0.2);
    border: 1px solid var(--color-accent);
    border-radius: 10px;
    color: var(--color-accent);
}

.teacher-tone {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    background: rgba(0, 212, 170, 0.2);
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    color: var(--color-primary);
}

.teacher-age {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Main Panel */
.main-panel {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--color-border);
}

/* Teacher Display */
.teacher-display {
    text-align: center;
    margin-bottom: 2rem;
}

.teacher-display .avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.speech-bubble {
    background: rgba(0, 212, 170, 0.1);
    border: 2px solid var(--color-primary);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--color-primary);
}

/* Lesson Panel */
.lesson-panel {
    margin-bottom: 2rem;
}

.word-display {
    background: rgba(124, 92, 255, 0.1);
    border: 2px solid var(--color-accent);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.word-display .word-english {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.word-display .word-phonetic {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.word-display .word-turkish {
    font-size: 1.5rem;
    color: var(--color-text);
}

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

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 170, 0.3);
}

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

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

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

/* Feedback */
.feedback {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.success {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--color-success);
}

.feedback.error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--color-error);
}

/* Progress */
.progress-container {
    margin-bottom: 2rem;
}

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

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

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Settings Panel */
.settings-panel {
    background: rgba(26, 31, 53, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.setting-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
}

/* Footer */
footer {
    position: relative;
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .teacher-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--color-border);
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Recording Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.recording {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================
   ANIMATED AVATAR SYSTEM
   ========================================== */

/* Avatar Container */
.avatar-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.avatar-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* SVG Avatar Base */
.avatar-svg {
    width: 100%;
    height: 100%;
}

/* Avatar Glow Effect */
.avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--avatar-color, var(--color-primary)) 0%, transparent 70%);
    opacity: 0.3;
    animation: glowPulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.5; }
}

/* Avatar States */
.avatar-container.listening .avatar-ear-left,
.avatar-container.listening .avatar-ear-right {
    animation: listen 1s ease-in-out infinite;
}

.avatar-container.idle .avatar-body {
    animation: breathe 4s ease-in-out infinite;
}

/* Eye Blink Animation - uses transform-box to keep position */
.avatar-eye {
    transform-box: fill-box;
    transform-origin: center center;
    animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

/* Breathing Animation - subtle body movement */
@keyframes breathe {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.95; }
}

/* Listen Animation - ear perk up */
@keyframes listen {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Sound Wave Animation (when speaking) */
.sound-waves {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container.speaking .sound-waves {
    opacity: 1;
}

.sound-wave {
    width: 4px;
    height: 20px;
    background: var(--avatar-color, var(--color-primary));
    border-radius: 2px;
    animation: soundWave 0.5s ease-in-out infinite;
}

.sound-wave:nth-child(1) { animation-delay: 0s; height: 15px; }
.sound-wave:nth-child(2) { animation-delay: 0.1s; height: 25px; }
.sound-wave:nth-child(3) { animation-delay: 0.2s; height: 20px; }
.sound-wave:nth-child(4) { animation-delay: 0.1s; height: 25px; }
.sound-wave:nth-child(5) { animation-delay: 0s; height: 15px; }

@keyframes soundWave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Avatar Color Themes */
.avatar-container[data-gender="female"] {
    --avatar-color: #ff6b9d;
    --avatar-secondary: #ffb3d0;
}

.avatar-container[data-gender="male"] {
    --avatar-color: #00d4aa;
    --avatar-secondary: #7dffd4;
}

.avatar-container[data-tone="fun"] {
    --avatar-accent: #ffd700;
}

.avatar-container[data-tone="calm"] {
    --avatar-accent: #87ceeb;
}

.avatar-container[data-tone="energetic"] {
    --avatar-accent: #ff4500;
}

.avatar-container[data-tone="friendly"] {
    --avatar-accent: #98fb98;
}

/* Expression Overlays */
.avatar-expression {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-container.happy .expression-happy,
.avatar-container.sad .expression-sad,
.avatar-container.excited .expression-excited {
    opacity: 1;
}

/* Status Indicator */
.avatar-status {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-success);
    border: 3px solid var(--color-surface);
    animation: statusPulse 2s ease-in-out infinite;
}

.avatar-container.speaking .avatar-status {
    background: var(--color-primary);
}

.avatar-container.listening .avatar-status {
    background: var(--color-secondary);
}

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

/* Floating Particles */
.avatar-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--avatar-color, var(--color-primary));
    border-radius: 50%;
    opacity: 0;
}

.avatar-container.speaking .particle {
    animation: floatParticle 2s ease-out infinite;
}

.particle:nth-child(1) { left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 40%; animation-delay: 0.3s; }
.particle:nth-child(3) { left: 60%; animation-delay: 0.6s; }
.particle:nth-child(4) { left: 80%; animation-delay: 0.9s; }

@keyframes floatParticle {
    0% { bottom: 30%; opacity: 0; transform: scale(0); }
    20% { opacity: 0.8; transform: scale(1); }
    100% { bottom: 100%; opacity: 0; transform: scale(0.5); }
}

/* Teaching Style Badge */
.teaching-style-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(124, 92, 255, 0.2));
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    color: var(--color-text);
}

/* Avatar Placeholder */
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.avatar-emoji {
    font-size: 8rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Hide emoji when avatar is rendered */
.avatar-container .avatar-wrapper + .avatar-placeholder,
.avatar-container:has(.avatar-wrapper) .avatar-placeholder {
    display: none;
}

/* Avatar container adjustments */
.teacher-display .avatar-container {
    width: 300px;
    height: 350px;
    margin: 0 auto 1.5rem;
}

/* When 3D avatar is present */
.teacher-display .avatar-container:has(.avatar3d-wrapper) {
    width: 300px;
    height: 350px;
}

.teacher-display .avatar-emoji {
    font-size: 8rem;
}

/* ==========================================
   Statistics Page Styles
   ========================================== */

.stats-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    z-index: 1;
}

/* Stats Overview Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card-primary {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), transparent);
}

.stat-card-success {
    border-color: var(--color-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}

.stat-card-info {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), transparent);
}

.stat-card-warning {
    border-color: var(--color-secondary);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), transparent);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

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

/* Stats Sections */
.stats-section {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.stats-section h2 {
    color: var(--color-text);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* Mastery Chart */
.mastery-chart {
    margin-top: 1rem;
}

.mastery-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.mastery-level {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s ease;
    min-width: 0;
}

.mastery-level.mastered {
    background: linear-gradient(90deg, var(--color-success), #34d399);
}

.mastery-level.practicing {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.mastery-level.learning {
    background: linear-gradient(90deg, var(--color-accent), #a78bfa);
}

.mastery-label {
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
}

.mastery-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

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

.legend-color.practicing {
    background: #f59e0b;
}

.legend-color.learning {
    background: var(--color-accent);
}

/* Category Progress */
.category-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.category-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--color-border);
}

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

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-weight: 600;
    color: var(--color-text);
}

.category-stats {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.category-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.category-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-percent {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
    text-align: right;
}

/* Word Filters */
.word-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

/* Word Progress List */
.word-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.word-progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}

.word-info .word-english {
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
}

.word-info .word-translation {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.word-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.word-mastery {
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.word-mastery.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.word-mastery.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.word-mastery.info {
    background: rgba(124, 92, 255, 0.2);
    color: var(--color-accent);
}

/* Empty/Loading Text */
.empty-text,
.loading-text {
    color: var(--color-text-muted);
    text-align: center;
    padding: 2rem;
}

/* Scrollbar for word list */
.word-progress-list::-webkit-scrollbar {
    width: 6px;
}

.word-progress-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.word-progress-list::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

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

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .word-progress-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .word-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==========================================
   Chat Page Styles
   ========================================== */

.chat-app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    height: calc(100vh - 250px);
    min-height: 500px;
    position: relative;
    z-index: 1;
}

/* Chat Sidebar */
.chat-sidebar {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    overflow-y: auto;
}

.chat-sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

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

.chat-teacher-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.chat-teacher-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-border);
}

.chat-teacher-item.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
    border-color: var(--color-primary);
}

.chat-teacher-item-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.chat-teacher-item-info h4 {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.chat-teacher-tone {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Chat Main Area */
.chat-main {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Teacher Header */
.chat-teacher-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
}

.chat-teacher-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar-emoji {
    font-size: 1.8rem;
}

.chat-teacher-info h3 {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.chat-teacher-info p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Chat Message */
.chat-message {
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

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

.chat-message-user {
    align-self: flex-end;
}

.chat-message-assistant {
    align-self: flex-start;
}

.chat-message-error {
    align-self: center;
}

.chat-message-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-message-text {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    line-height: 1.5;
}

.chat-message-user .chat-message-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-message-text {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-message-error .chat-message-text {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
    font-size: 0.9rem;
}

/* Chat Input */
.chat-input-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 25px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    white-space: nowrap;
}

.chat-voice-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-voice-btn.recording {
    background: var(--color-error);
    animation: pulse 1s infinite;
}

.chat-hint {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Chat Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

/* Responsive Chat */
@media (max-width: 900px) {
    .chat-app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: calc(100vh - 200px);
    }

    .chat-sidebar {
        max-height: 150px;
    }

    .chat-teacher-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
    }

    .chat-teacher-item {
        flex-shrink: 0;
        width: auto;
    }

    .chat-teacher-item-info h4 {
        font-size: 0.8rem;
    }

    .chat-message {
        max-width: 90%;
    }
}

@media (max-width: 600px) {
    .chat-app-container {
        padding: 1rem;
    }

    .chat-input-wrapper {
        flex-wrap: wrap;
    }

    .chat-input {
        width: 100%;
        flex: auto;
    }

    .chat-send-btn {
        flex: 1;
    }
}

/* ==========================================
   COMPACT LAYOUT - MOBILE FIRST
   ========================================== */

/* === BASE (Mobile) === */
.app-container-compact {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-compact {
    order: -1;
}

.sidebar-compact h2 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    padding-left: 0.5rem;
}

.sidebar-compact .teacher-grid {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sidebar-compact .teacher-grid::-webkit-scrollbar {
    display: none;
}

.sidebar-compact .teacher-card {
    flex-shrink: 0;
    width: 130px;
    padding: 0.5rem;
    gap: 0.4rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-compact .teacher-avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.sidebar-compact .teacher-info {
    width: 100%;
}

.sidebar-compact .teacher-info h3 {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-compact .teacher-info p {
    display: none;
}

.sidebar-compact .teacher-tags {
    justify-content: center;
    margin-top: 0.2rem;
}

.sidebar-compact .teacher-accent,
.sidebar-compact .teacher-tone {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
}

.sidebar-compact .teacher-age {
    display: none;
}

.main-panel-compact {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
}

.lesson-top {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.avatar-section {
    text-align: center;
    order: 1;
}

.avatar-section h3 {
    font-size: 0.9rem;
    margin-top: 0.25rem;
    color: var(--color-text);
}

.avatar-section .avatar-container {
    width: 180px;
    height: 200px;
    margin: 0 auto;
}

.avatar-section .teaching-style-badge {
    margin-top: 0.2rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.6rem;
}

.lesson-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    order: 2;
}

.speech-bubble-compact {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.speech-bubble-compact::before {
    display: none;
}

.word-display-compact {
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.word-display-compact .word-english {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
}

.word-display-compact .word-phonetic {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 0.15rem;
}

.word-display-compact .word-turkish {
    font-size: 1rem;
    color: var(--color-text);
}

.progress-container-compact {
    margin: 0;
}

.progress-container-compact .progress-bar {
    height: 5px;
    margin-bottom: 0.2rem;
}

.progress-container-compact .progress-text {
    font-size: 0.7rem;
}

.controls-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.controls-compact .btn {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    justify-content: center;
}

.controls-compact .btn:last-child {
    grid-column: span 2;
}

.settings-panel-compact {
    background: rgba(26, 31, 53, 0.5);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Level Indicator */
.level-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.level-badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.xp-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.settings-panel-compact .setting-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.settings-panel-compact .setting-group label {
    font-size: 0.7rem;
    margin-bottom: 0;
    white-space: nowrap;
    min-width: 60px;
}

.settings-panel-compact .setting-group select,
.settings-panel-compact .setting-group input {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    flex: 1;
}

/* === TABLET (min-width: 600px) === */
@media (min-width: 600px) {
    .app-container-compact {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .sidebar-compact .teacher-card {
        width: 150px;
        flex-direction: row;
        text-align: left;
    }

    .sidebar-compact .teacher-info h3 {
        font-size: 0.8rem;
    }

    .sidebar-compact .teacher-tags {
        justify-content: flex-start;
    }

    .main-panel-compact {
        padding: 1rem;
    }

    .avatar-section .avatar-container {
        width: 220px;
        height: 240px;
    }

    .word-display-compact .word-english {
        font-size: 2rem;
    }

    .controls-compact {
        grid-template-columns: repeat(3, 1fr);
    }

    .controls-compact .btn:last-child {
        grid-column: auto;
    }

    .settings-panel-compact {
        flex-direction: row;
        gap: 1rem;
    }

    .settings-panel-compact .setting-group {
        width: auto;
    }
}

/* === DESKTOP (min-width: 900px) === */
@media (min-width: 900px) {
    .app-container-compact {
        padding: 1rem 1.5rem;
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 1rem;
    }

    .sidebar-compact {
        order: 0;
        position: sticky;
        top: 1rem;
        height: fit-content;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .sidebar-compact h2 {
        font-size: 0.9rem;
        padding-left: 0;
    }

    .sidebar-compact .teacher-grid {
        display: flex;
        flex-direction: column;
        overflow-x: visible;
        padding: 0;
    }

    .sidebar-compact .teacher-card {
        width: 100%;
        padding: 0.5rem;
    }

    .sidebar-compact .teacher-info p {
        display: block;
        font-size: 0.7rem;
    }

    .lesson-top {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 1rem;
        align-items: start;
    }

    .avatar-section {
        order: 0;
    }

    .avatar-section .avatar-container {
        width: 240px;
        height: 260px;
    }

    .lesson-section {
        order: 0;
        gap: 0.6rem;
    }

    .speech-bubble-compact {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .speech-bubble-compact::before {
        display: block;
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid var(--color-primary);
    }
}

/* === LARGE DESKTOP (min-width: 1200px) === */
@media (min-width: 1200px) {
    .app-container-compact {
        grid-template-columns: 220px 1fr;
    }

    .lesson-top {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }

    .avatar-section .avatar-container {
        width: 260px;
        height: 280px;
    }

    .sidebar-compact .teacher-card {
        padding: 0.6rem;
    }

    .sidebar-compact .teacher-avatar {
        width: 40px;
        height: 40px;
    }

    .sidebar-compact .teacher-info h3 {
        font-size: 0.85rem;
    }

    .sidebar-compact .teacher-age {
        display: block;
        font-size: 0.6rem;
        margin-top: 0.2rem;
    }
}

/* ==========================================
   Profile Page Styles
   ========================================== */

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.profile-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .profile-container {
        padding: 2rem;
    }

    .profile-title {
        font-size: 2rem;
    }
}

.profile-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
}

.profile-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.profile-stats-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar span {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.profile-stats-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.profile-joined {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.profile-quick-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.quick-stat {
    text-align: center;
}

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

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Profile Forms */
.profile-card .form-group {
    margin-bottom: 1rem;
}

.profile-card .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.profile-card .form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.95rem;
}

.profile-card .form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.profile-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Badges */
.profile-badges-card {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .profile-badges-card {
        grid-column: span 2;
    }
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .badges-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.badge-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.badge-item:not(.locked) {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.badge-name {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: center;
}

.badge-item:not(.locked) .badge-name {
    color: var(--color-text);
}

/* Danger Zone */
.profile-danger-card {
    border-color: var(--color-error);
    background: rgba(239, 68, 68, 0.05);
}

.profile-danger-card h3 {
    color: var(--color-error);
}

.profile-danger-card p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.btn-danger {
    background: var(--color-error);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

/* ==========================================
   3D Avatar Styles (TalkingHead)
   ========================================== */

.avatar3d-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
}

.avatar3d-canvas {
    width: 100%;
    height: 100%;
    min-height: 280px;
}

.avatar3d-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px;
}

.avatar3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 28, 0.8);
    color: var(--color-text-muted);
    gap: 1rem;
    z-index: 10;
}

.avatar3d-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.avatar3d-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.1));
}

.avatar3d-emoji {
    font-size: 8rem;
    animation: float 3s ease-in-out infinite;
}

.avatar3d-fallback.speaking .avatar3d-emoji {
    animation: float 3s ease-in-out infinite, pulse 0.3s ease-in-out infinite;
}

.avatar3d-fallback.listening .avatar3d-emoji {
    animation: float 3s ease-in-out infinite, glow 1s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 10px var(--color-primary)); }
    50% { filter: drop-shadow(0 0 20px var(--color-primary)); }
}

/* 3D Avatar Container in Teacher Display */
.teacher-display .avatar3d-wrapper {
    width: 300px;
    height: 350px;
    margin: 0 auto 1.5rem;
}

/* 3D Avatar in Compact Layout - Mobile First */
.avatar-section .avatar3d-wrapper {
    width: 100%;
    height: 100%;
    min-height: 180px;
    margin: 0;
}

.avatar-section .avatar3d-canvas {
    min-height: 180px;
}

.avatar-section .avatar3d-emoji {
    font-size: 5rem;
}

@media (min-width: 600px) {
    .avatar-section .avatar3d-wrapper {
        min-height: 220px;
    }

    .avatar-section .avatar3d-canvas {
        min-height: 220px;
    }

    .avatar-section .avatar3d-emoji {
        font-size: 6rem;
    }
}

@media (min-width: 900px) {
    .avatar-section .avatar3d-wrapper {
        min-height: 240px;
    }

    .avatar-section .avatar3d-canvas {
        min-height: 240px;
    }

    .avatar-section .avatar3d-emoji {
        font-size: 7rem;
    }
}

@media (min-width: 1200px) {
    .avatar-section .avatar3d-wrapper {
        min-height: 260px;
    }

    .avatar-section .avatar3d-canvas {
        min-height: 260px;
    }

    .avatar-section .avatar3d-emoji {
        font-size: 8rem;
    }
}

/* Responsive 3D Avatar */
@media (max-width: 768px) {
    .teacher-display .avatar3d-wrapper {
        width: 250px;
        height: 300px;
    }

    .avatar3d-emoji {
        font-size: 6rem;
    }
}
