/* ============================================
   Audio2Video - Premium Dark Theme
   ============================================ */

:root {
    --bg-primary: #07070d;
    --bg-secondary: #0e0e18;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f1f1f3;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-dark: #5b21b6;
    --success: #10b981;
    --success-dark: #059669;
    --error: #ef4444;
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, #7c3aed, #2563eb);
    --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(37, 99, 235, 0.4));
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(37, 99, 235, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Navigation ---- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-brand svg {
    width: 24px;
    height: 24px;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

/* ---- Header ---- */
header {
    padding: 48px 0 32px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    display: flex;
    filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.4));
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 .accent {
    -webkit-text-fill-color: var(--accent-light);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-glow {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(124, 58, 237, 0.5); }
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

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

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ---- Upload Zone ---- */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-card);
    cursor: pointer;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-icon {
    color: var(--accent-light);
    opacity: 0.7;
    transition: all var(--transition);
}

.upload-zone:hover .upload-icon {
    opacity: 1;
    transform: translateY(-4px);
}

.upload-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-content p strong {
    color: var(--text-primary);
}

/* ---- Tracks Section ---- */
.tracks-section {
    margin-top: 40px;
}

.tracks-section.hidden { display: none; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.badge {
    background: var(--gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 100px;
    min-width: 28px;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---- Track List ---- */
.track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-card {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
}

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

.track-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.track-cover {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.track-cover::after {
    content: 'Change Cover';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: all var(--transition);
}

.track-cover:hover::after {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-cover .no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(37, 99, 235, 0.2));
}

.track-info {
    min-width: 0;
}

.track-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.track-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.edit-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    padding: 2px 4px;
    margin-left: -4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.edit-input:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
}

.edit-input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-style: solid;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.track-filename {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Track Status ---- */
.track-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: flex-end;
}

.status-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-ready { color: var(--text-secondary); }
.status-converting { color: var(--warning); }
.status-done { color: var(--success); }
.status-error { color: var(--error); }

.progress-bar {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 100px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

/* ---- Track Actions ---- */
.track-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-icon.btn-download {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-icon.btn-download:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    animation: toastIn 0.4s ease;
}

.toast.hidden { display: none; }

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

.toast-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.toast-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-text strong {
    font-size: 0.85rem;
}

.toast-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ---- Footer ---- */
footer {
    padding: 40px 0;
    text-align: center;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.security-badge svg {
    color: var(--success);
    opacity: 0.7;
}

/* ---- Hidden ---- */
.hidden { display: none !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .track-card {
        grid-template-columns: 48px 1fr;
        gap: 10px;
    }
    .track-status, .track-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .header-actions {
        width: 100%;
    }
}

/* =========================================
   SEO & Landing Page Content 
   ========================================= */

.seo-content {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.seo-container {
    max-width: 800px;
    margin: 0 auto;
}

.seo-block {
    margin-bottom: 3rem;
}

.seo-block h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.seo-block h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.seo-block p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.seo-block ul, .seo-block ol {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-block li {
    margin-bottom: 0.5rem;
}

.seo-block strong {
    color: var(--text);
}

.faq-item {
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: transform var(--transition);
}

.faq-item:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.faq-item h3 {
    margin-top: 0;
}

.faq-item p:last-child {
    margin-bottom: 0;
}

.footer-links {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
