/* ═══════════════════════════════════════════════════════
   SoundForge Studio — Common Design System
   Premium dark mode with gold→pink gradient accent
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0F0F1A;
    --bg-secondary: #161625;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(245, 158, 11, 0.4);

    --gold: #F59E0B;
    --pink: #EC4899;
    --purple: #8B5CF6;
    --blue: #3B82F6;
    --green: #10B981;
    --red: #EF4444;

    --gradient-accent: linear-gradient(135deg, var(--gold), var(--pink));
    --gradient-accent-soft: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-glow: 0 0 30px rgba(245, 158, 11, 0.1);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

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

/* ── Background Particles ───────────────────────────── */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(236, 72, 153, 0.04) 0%, transparent 50%);
    animation: bgDrift 20s ease-in-out infinite;
}

@keyframes bgDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -1%) rotate(1deg); }
    66% { transform: translate(-1%, 2%) rotate(-1deg); }
}

/* ── App Container ──────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ── App Content ────────────────────────────────────── */
.app-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ── Header ─────────────────────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 12px;
    gap: 16px;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent-soft);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ── Nav Tabs ───────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.nav-tab {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.nav-tab.active {
    background: var(--gradient-accent-soft);
    color: var(--gold);
    border: 1px solid var(--gold);
    box-shadow: 0 0 16px rgba(245,158,11,0.15);
}

/* ── Buttons ────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #0F0F1A;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.35);
}

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

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

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

.btn-accent {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.btn-sm:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

/* ── Form Elements ──────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-field {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.input-field:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

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

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-hint a {
    color: var(--gold);
    text-decoration: none;
}

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0;
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    font-size: 1.2rem;
    border: none;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

/* ── Loading Overlay ────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Notifications ──────────────────────────────────── */
#notifications {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.notification {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
}

.notification.success { border-left: 3px solid var(--green); }
.notification.error { border-left: 3px solid var(--red); }
.notification.info { border-left: 3px solid var(--blue); }
.notification.warning { border-left: 3px solid var(--gold); }

.notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

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

@keyframes slideOut {
    to { opacity: 0; transform: translateX(100%); }
}

.notification-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
    .app-container { padding: 16px 12px 40px; }
    .app-content { padding: 0 0 40px; }
    .form-grid { grid-template-columns: 1fr; }

    .app-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .nav-tab {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }

    .logo-text {
        font-size: 1.3rem;
    }
}
