@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #475569;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    background-color: var(--bg-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Professional Header */
.app-header {
    height: 72px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stat Pills */
.stat-pill {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

/* Learning Studio Layout */
.studio-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.learning-card {
    background: var(--card-bg);
    border-radius: 32px;
    border: 1px solid var(--border);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#original_script {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    outline: none;
    transition: color 0.3s ease;
}

.ipa-badge {
    display: inline-flex;
    background: #f1f5f9;
    color: var(--secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    font-family: 'Inter', monospace;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Control Hub */
.control-hub {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
}

.btn-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.btn-circle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-primary-circle {
    width: 88px;
    height: 88px;
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary-circle:hover {
    background: var(--primary-hover);
    color: white;
    transform: scale(1.05);
}

.btn-circle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* AI Coach Sidebar/Drawer */
#ai_feedback_container {
    background: #fdf2f8; /* Light pink/indigo tint */
    border: 1px solid #fbcfe8;
    border-radius: 24px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: left;
    animation: slideUp 0.4s ease-out;
}

#ai_feedback_text {
    color: #831843;
    font-size: 1rem;
    line-height: 1.6;
}

/* Floating CEFR Slider */
.cefr-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem 2rem;
    border-radius: 20px;
    width: 320px;
    color: white;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    transition: all 0.3s ease;
}

#cefrSlider {
    accent-color: var(--primary);
}

#levelLabel {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
        height: 64px;
    }
    
    .logo-text { font-size: 1.25rem; }
    
    .stat-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .studio-container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .learning-card {
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }

    #original_script {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .ipa-badge {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }

    .control-hub {
        gap: 1.25rem;
        margin-top: 2rem;
    }

    .btn-circle {
        width: 56px;
        height: 56px;
    }

    .btn-primary-circle {
        width: 72px;
        height: 72px;
    }

    .cefr-dock {
        width: calc(100% - 2rem);
        bottom: 1rem;
        padding: 0.75rem 1.5rem;
    }

    #pronunciation_accuracy {
        font-size: 2.25rem;
    }
}

/* Results Display */
#pronunciation_accuracy {
    font-size: 3rem;
    font-weight: 800;
    margin-top: 1rem;
    background: linear-gradient(to bottom right, var(--success), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
