:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --success: #22c55e;
    --danger: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --radius: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(51, 65, 85, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.lang-select {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.lang-select:hover {
    border-color: var(--primary);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--border);
}

.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent),
                radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.15), transparent);
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Recorder Card */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.recorder-card {
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    margin: 0 auto;
    transition: var(--transition);
    animation: float 6s ease-in-out infinite;
}

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

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.dot.recording {
    background-color: var(--danger);
    animation: pulse 1.5s infinite;
}

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

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-main);
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

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

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

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

.hidden {
    display: none !important;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    gap: 0.75rem;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--border);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-container input:checked + .checkmark {
    background: var(--primary);
}

.checkbox-container input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Action Footer */
.action-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Preview Panel */
.preview-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-width: calc(100vw - 4rem);
    z-index: 100;
    border-radius: var(--radius);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.preview-header {
    background: var(--surface);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: var(--text-muted);
}

#preview-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: block;
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.bg-purple { background: #a855f7; }
.bg-blue { background: #3b82f6; }
.bg-pink { background: #ec4899; }

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Playback Section */
.playback-section {
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    background: var(--background);
}

.dropzone-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    border-radius: var(--radius);
    position: relative;
}

.dropzone {
    border: 3px dashed var(--border);
    border-radius: calc(var(--radius) - 0.5rem);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

.dropzone-content {
    text-align: center;
    padding: 2rem;
    pointer-events: none;
}

.drop-icon {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.dropzone-content p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.dropzone-content .hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

#playback-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: black;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Footer */
footer {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--surface);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out forwards;
    cursor: pointer;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 1rem; }
    .nav-links { display: none; }
    .hero { padding: 4rem 1rem; }
    .hero-title { font-size: 2.5rem; }
    .recorder-card { width: 100%; }
    .preview-container {
        width: calc(100vw - 2rem);
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
