:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --mic-active: #ef4444;
    --mic-active-glow: rgba(239, 68, 68, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: radial-gradient(circle at top, #1e293b, #0f172a);
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--accent);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

#status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 20px;
    margin: 0 auto 2rem auto;
    width: fit-content;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.hidden {
    display: none !important;
}

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

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

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

.flashcard {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flashcard:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.flashcard .headline {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
}

.flashcard .key-stat {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.flashcard .summary {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.controls-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 90%;
    max-width: 500px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 40px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
}

#text-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
}

#text-input::placeholder {
    color: var(--text-muted);
}

.input-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.action-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.mic-btn-large {
    background: var(--card-bg);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.mic-btn-large:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.mic-btn-large.active {
    background: var(--mic-active);
    border-color: var(--mic-active);
    box-shadow: 0 0 30px var(--mic-active-glow);
    animation: pulse 1.5s infinite;
}

.mic-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.mic-btn.active {
    background: var(--mic-active);
    border-color: var(--mic-active);
    box-shadow: 0 0 30px var(--mic-active-glow);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--mic-active-glow); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-btn-large.playing {
    background: var(--card-bg);
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    animation: pulse-accent 2s infinite;
}

@keyframes pulse-accent {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
