:root {
    --bg-main: #050508;
    --bg-card: rgba(15, 15, 20, 0.6);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --success: #10b981;
    --error: #ef4444;
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Backgrounds */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: 
        radial-gradient(at 0% 0%, rgba(99,102,241,0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139,92,246,0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99,102,241,0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139,92,246,0.05) 0px, transparent 50%);
}

.light-rays {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    z-index: -1;
    background: repeating-conic-gradient(from 0deg, transparent 0deg 10deg, rgba(255, 255, 255, 0.01) 15deg 20deg);
    animation: raysRotate 120s linear infinite;
    mask-image: radial-gradient(circle, black, transparent 70%);
}

@keyframes raysRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.main-header { padding: 2rem 0; }
.navbar { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -1px; }
.logo .accent-text { color: var(--accent); }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: var(--transition); }
.nav-link:hover { color: #fff; }

/* Hero */
.hero-section {
    text-align: center;
    padding: 4rem 0 5rem;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 2rem auto 0;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2rem;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bento-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.15); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }

.converter-card { grid-column: span 3; grid-row: span 2; }
.stats-card { grid-column: span 1; grid-row: span 2; display: flex; flex-direction: column; }
.feature-card { grid-column: span 2; }

/* Tabs & Body */
.tab-system { display: flex; gap: 8px; margin-bottom: 2rem; background: rgba(0,0,0,0.2); padding: 4px; border-radius: 12px; width: fit-content; }
.tab-btn { background: transparent; border: none; color: var(--text-secondary); padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.tab-btn.active { background: var(--accent); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Drop Zone */
.drop-zone { border: 2px dashed var(--border); border-radius: 20px; padding: 3rem 1.5rem; text-align: center; transition: var(--transition); background: rgba(255,255,255,0.01); }
.drop-zone:hover { border-color: var(--accent); background: rgba(99,102,241,0.03); }
.drop-zone-icon { color: var(--accent); margin-bottom: 1.5rem; }
.drop-zone h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.drop-zone p { color: var(--text-secondary); margin-bottom: 2rem; }

/* YouTube Input */
.url-input-wrap { padding: 1rem 0; }
.input-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px; font-weight: 600; }
.input-group { display: flex; gap: 12px; }
input[type="text"] { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; color: #fff; font-family: inherit; font-size: 1rem; }
input[type="text"]:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn { padding: 0.8rem 1.5rem; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #4f46e5; transform: scale(1.02); }
.btn.success { background: var(--success); color: #fff; }
.btn.secondary { background: rgba(255,255,255,0.05); color: #fff; }
.btn.ghost { background: transparent; color: var(--error); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn.full-width { width: 100%; margin-top: 10px; }

/* Stats */
.stats-list { margin: 1.5rem 0; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.stat-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); padding: 1rem; border-radius: 16px; border: 1px solid var(--border); }
.stat-item .label { font-size: 0.85rem; color: var(--text-secondary); }
.stat-item .value { font-weight: 800; font-size: 1.2rem; }
.stat-item.success .value { color: var(--success); }
.stat-item.error .value { color: var(--error); }

/* Feature Cards */
.feat-icon { font-size: 1.5rem; margin-bottom: 1rem; }
.feature-card h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* File List */
.file-list { list-style: none; margin-top: 2rem; }
.file-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 1.25rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; backdrop-filter: var(--glass-blur); }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; font-size: 1rem; }
.file-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; gap: 12px; align-items: center; }
.progress-container { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease; }

.status-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.status-pending { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.status-converting { background: rgba(99,102,241,0.1); color: var(--accent); }
.status-done { background: rgba(16,185,129,0.1); color: var(--success); }
.status-error { background: rgba(239,68,68,0.1); color: var(--error); }

/* Loader */
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-main); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.5s; }
.loader-overlay.active { opacity: 1; pointer-events: auto; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.main-footer { padding: 4rem 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-secondary); font-size: 0.85rem; }

/* Mobile */
@media (max-width: 992px) {
    .bento-grid { grid-template-columns: 1fr; }
    .converter-card, .stats-card, .feature-card { grid-column: span 1; grid-row: auto; }
    h1 { font-size: 3rem; }
}

@media (max-width: 640px) {
    .navbar { font-size: 0.9rem; }
    .hero-section { padding: 2rem 0; }
    .input-group { flex-direction: column; }
    .file-item { flex-direction: column; align-items: stretch; }
}
