/* =========================
   CSS Variables
   ========================= */
:root {
    --bg: #0f1115;
    --panel: #161922;
    --panel-2: #1d212d;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --accent: #3b82f6;
}

/* =========================
   Base Styles
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, 'Helvetica Neue', sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08), transparent 30%),
                radial-gradient(circle at 80% 0%, rgba(94, 234, 212, 0.05), transparent 25%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* =========================
   Component Styles
   ========================= */
.glass {
    background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.panel {
    background: var(--panel);
}

.panel-2 {
    background: var(--panel-2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(120deg, #2563eb, #1d4ed8);
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.25);
    transition: all 150ms;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: var(--panel);
    border: 1px solid #1e293b;
    font-size: 0.875rem;
    color: #e2e8f0;
    transition: all 150ms;
}

.btn-secondary:hover {
    border-color: #475569;
}

.player-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: #1e293b;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 150ms;
}

.player-btn:hover {
    background: #334155;
}

/* Form Elements */
.input {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}

.text-input {
    width: 100%;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
    border-radius: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Labels & Text */
.label {
    font-size: 0.875rem;
    color: #cbd5e1;
}

.hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Cards */
.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    border-radius: 1.5rem;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .card {
        padding: 2rem;
    }
}

.audio-card {
    background: var(--panel-2);
    border: 1px solid #1e293b;
    border-radius: 1rem;
    padding: 1rem;
}

/* Badges */
.badge {
    background: rgba(59,130,246,0.12);
    color: #bfdbfe;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Range Input / Progress Bar */
input[type=range].progress {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #dbeafe, #94a3b8);
}

input[type=range].progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

input[type=range].progress::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    border: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 50;
    background: rgba(17, 24, 39, 0.95);
    color: #f8fafc;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast-error {
    border-color: rgba(248,113,113,0.5);
    color: #fecdd3;
}

.toast-success {
    border-color: rgba(94,234,212,0.4);
    color: #d1fae5;
}

/* =========================
   Layout Utilities
   ========================= */
.container {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.flex-1 {
    flex: 1;
}

.hidden {
    display: none;
}

/* =========================
   Spacing Utilities
   ========================= */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* =========================
   Sizing Utilities
   ========================= */
.w-full { width: 100%; }
.h-full { height: 100%; }

.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.h-12 { height: 3rem; }

.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-11 { width: 2.75rem; }
.w-12 { width: 3rem; }

.max-w-6xl { max-width: 72rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }

.min-h-screen { min-height: 100vh; }

/* =========================
   Border & Radius Utilities
   ========================= */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; }
.border-2 { border-width: 2px; }

.border-slate-600 { border-color: #475569; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }

/* =========================
   Typography Utilities
   ========================= */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================
   Color Utilities
   ========================= */
.text-white { color: #ffffff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }

.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }

.text-red-500 { color: #ef4444; }

.bg-white { background-color: #ffffff; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }

/* =========================
   Effect Utilities
   ========================= */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

.shadow-blue-500\/30 { box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3); }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* =========================
   Transition Utilities
   ========================= */
.transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* =========================
   Hover States
   ========================= */
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-slate-600:hover { background-color: #475569; }
.hover\:border-slate-600:hover { border-color: #475569; }
.hover\:text-blue-400:hover { color: #60a5fa; }

/* =========================
   Responsive Utilities (md: 768px+)
   ========================= */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:p-8 { padding: 2rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}
