@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --danger: #EF4444;
    --bg-color: #F8FAFC;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-border: rgba(0, 0, 0, 0.1);
    --text-main: #0F172A;
    --text-muted: #64748B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background animated glow */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    animation: float 10s infinite alternate;
}

body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    animation: float 15s infinite alternate-reverse;
}

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

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

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
}

nav .logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, #4F46E5, #10B981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

/* Cards (Glassmorphism) */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 1rem; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
p { font-size: 1.125rem; color: var(--text-muted); line-height: 1.6; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(79, 70, 229, 0.1);
}

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

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Session Screen */
.session-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}
.word-display {
    font-size: 3rem;
    font-weight: 800;
    margin: 2rem 0;
    min-height: 80px;
}
.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mic-btn.listening {
    background: var(--danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-danger 1.5s infinite;
}
.feedback-box {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}
.feedback-box.show {
    opacity: 1;
    transform: translateY(0);
}
.feedback-correct { background: rgba(16, 185, 129, 0.2); border: 1px solid var(--secondary); color: var(--secondary); }
.feedback-wrong { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--danger); color: var(--danger); }
.feedback-synonym { background: rgba(59, 130, 246, 0.2); border: 1px solid #3b82f6; color: #3b82f6; }

@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Animations for session */
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
.pop { animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .glass-card { padding: 1.5rem; }
    .mission-control { gap: 1rem; }
    .filters { flex-direction: column; }
    .word-display { font-size: 2.5rem; }
}

/* --- FLASHCARD UI --- */
.session-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.session-nav {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1.5rem;
}

.close-btn {
    color: var(--text-muted);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.progress-bar-container {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.flashcard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.card-badge {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    align-self: center;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 35vh;
}

.question-type {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mic-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    padding-bottom: 2rem;
}

.mic-hint {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    min-height: 1.5rem;
}

.end-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}
