:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-color: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.3);
    --accent-color: #f43f5e;
    --success-color: #10b981;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
}

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

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.05), transparent 400px),
                radial-gradient(circle at bottom left, rgba(244, 63, 94, 0.05), transparent 400px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
    margin-left: 4px;
    font-size: 0.7rem;
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.status-badge.recording {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.1);
}

.script-section {
    flex-shrink: 0;
}

.label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.script-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#script-content {
    font-size: 1.15rem;
    line-height: 1.6;
    font-weight: 400;
    color: #e2e8f0;
}

.visualizer-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

#waveform-canvas {
    width: 100%;
    height: 150px;
}

.timer {
    font-family: 'Outfit', monospace;
    font-size: 2.5rem;
    font-weight: 300;
    margin-top: 10px;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
}

.primary-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.primary-btn span {
    position: absolute;
    bottom: -30px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Red recording pulse circle */
.icon-pulse {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.primary-btn.recording {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
}

.primary-btn.recording .icon-pulse {
    background: var(--accent-color);
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.action-group {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.secondary-btn, .success-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

@media (max-height: 600px) {
    .app-container { gap: 12px; padding: 16px; }
    .timer { font-size: 2rem; }
    #waveform-canvas { height: 100px; }
}
