/* ==========================================================================
   YT Audio Vault — Premium Design System & Theme
   ========================================================================== */

:root {
    --bg-base: #080C15;
    --bg-surface: #0E1526;
    --bg-surface-elevated: #162036;
    --bg-glass: rgba(14, 21, 38, 0.75);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(239, 68, 68, 0.35);

    --primary: #EF4444;
    --primary-glow: rgba(239, 68, 68, 0.5);
    --primary-gradient: linear-gradient(135deg, #FF1E42 0%, #E11D48 50%, #BE123C 100%);
    
    --accent-indigo: #6366F1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.3);
    --accent-cyan: #06B6D4;
    --accent-emerald: #10B981;

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

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px -10px rgba(239, 68, 68, 0.25);
    --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Ambient glow orbs in background */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(140px);
    opacity: 0.35;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #EF4444 0%, transparent 70%);
    top: -150px;
    left: 20%;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366F1 0%, transparent 70%);
    top: 400px;
    right: -100px;
}

.glow-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #06B6D4 0%, transparent 70%);
    bottom: -100px;
    left: 10%;
}

.app-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(8, 12, 21, 0.82);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: transform var(--transition-fast);
}

.brand:hover .brand-icon {
    transform: scale(1.05) rotate(-3deg);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 4px;
}

.brand-text h1 span {
    background: linear-gradient(135deg, #FF6B8B 0%, #EF4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vps-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Space Grotesk', monospace;
    margin-top: 2px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.stats-pill {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.stats-pill:hover {
    color: #FFF;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.btn-ghost-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.btn-ghost-nav:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   Main Container & Hero
   ========================================================================== */

.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    width: 100%;
}

.downloader-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-full);
    color: #FCA5A5;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    color: #FFF;
}

.hero-title span {
    background: linear-gradient(135deg, #FF4D6D 0%, #F43F5E 50%, #EF4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 36px;
}

/* ==========================================================================
   Input Card Component
   ========================================================================== */

.input-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-soft), 0 0 60px -20px rgba(0, 0, 0, 0.8);
    position: relative;
    backdrop-filter: blur(16px);
    transition: border-color var(--transition-smooth);
}

.input-card:focus-within {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: var(--shadow-soft), 0 0 40px -10px rgba(239, 68, 68, 0.2);
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    gap: 12px;
    transition: border-color var(--transition-fast);
}

.url-input-wrapper:focus-within {
    border-color: var(--primary);
}

.input-prefix-icon {
    color: #EF4444;
    display: flex;
    align-items: center;
    padding-left: 6px;
}

.url-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFF;
    font-size: 1.05rem;
    font-family: inherit;
    padding: 10px 4px;
}

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

.btn-input-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn-input-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFF;
}

/* Format & Quality Toolbar */
.options-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.format-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chip-label {
    cursor: pointer;
    position: relative;
}

.chip-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    user-select: none;
}

.chip-label:hover .chip-content {
    background: rgba(255, 255, 255, 0.07);
    color: #FFF;
}

.chip-label.active .chip-content,
.chip-label input:checked ~ .chip-content {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #FFF;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.quality-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.quality-select-wrap select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #FFF;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.quality-select-wrap select:focus {
    border-color: var(--primary);
}

/* CTA Row */
.form-cta-row {
    display: flex;
    justify-content: stretch;
}

.btn-primary-glow {
    width: 100%;
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    background: var(--primary-gradient);
    border: none;
    color: #FFF;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 30px var(--primary-glow);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-primary-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    transition: 0.75s;
}

.btn-primary-glow:hover::after {
    left: 150%;
}

.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.6);
}

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

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

/* ==========================================================================
   Active Task / Progress Card
   ========================================================================== */

.task-card {
    margin-top: 28px;
    background: var(--bg-surface);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 10px 40px -15px rgba(239, 68, 68, 0.2);
    animation: slideUpFade 0.4s var(--transition-smooth);
}

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

.task-card-inner {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.task-thumb-wrap {
    position: relative;
    width: 200px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.task-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #FFF;
}

.task-details {
    flex: 1;
    min-width: 0;
}

.task-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.channel-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-loading {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.spinner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.2; }
    to { opacity: 1; }
}

.task-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-base);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF1E42, #F43F5E, #FB7185);
    border-radius: var(--radius-full);
    transition: width 0.25s linear;
    background-size: 30px 30px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.task-metrics {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', monospace;
}

.task-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Player Card Component
   ========================================================================== */

.player-card {
    margin-top: 32px;
    background: linear-gradient(135deg, #111A30 0%, #151D33 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.7), 0 0 35px -5px rgba(99, 102, 241, 0.15);
    animation: slideUpFade 0.4s var(--transition-smooth);
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    position: relative;
    z-index: 2;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.player-artwork {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

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

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

.now-playing-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--accent-emerald);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.bars-animation {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.bars-animation span {
    width: 2.5px;
    background: var(--accent-emerald);
    border-radius: 1px;
    animation: dance 0.9s ease-in-out infinite alternate;
}

.bars-animation span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.bars-animation span:nth-child(2) { height: 90%; animation-delay: 0.3s; }
.bars-animation span:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.bars-animation span:nth-child(4) { height: 100%; animation-delay: 0.4s; }
.bars-animation span:nth-child(5) { height: 50%; animation-delay: 0.15s; }

.bars-animation.is-paused span {
    animation-play-state: paused;
    height: 30% !important;
}

@keyframes dance {
    0% { height: 20%; }
    100% { height: 100%; }
}

.player-track-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-track-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.format-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    font-weight: 600;
}

.player-center {
    flex: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-ctrl {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-ctrl:hover {
    color: #FFF;
}

.btn-ctrl-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px var(--primary-glow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-ctrl-play:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.6);
}

.scrubber-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Space Grotesk', monospace;
    min-width: 40px;
}

.scrubber-slider-wrap {
    flex: 1;
    position: relative;
    height: 6px;
    display: flex;
    align-items: center;
}

.scrubber-slider-wrap input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.scrubber-slider-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.scrubber-fill {
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    position: relative;
    pointer-events: none;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-player-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #FFF;
    color: #0F172A;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.btn-player-cta:hover {
    background: #F1F5F9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
}

.btn-icon-subtle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFF;
}

/* ==========================================================================
   Library Section
   ========================================================================== */

.library-section {
    margin-top: 60px;
}

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

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

.icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-indigo);
}

.section-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #FFF;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

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

.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 7px 16px;
    gap: 8px;
    color: var(--text-muted);
}

.search-input-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #FFF;
    font-size: 0.85rem;
    font-family: inherit;
    width: 200px;
}

.btn-icon-refresh {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-refresh:hover {
    color: #FFF;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Library Cards Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.audio-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.audio-item-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
}

.audio-card-top {
    display: flex;
    gap: 14px;
}

.card-thumb-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}

.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    opacity: 0;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.card-thumb-wrap:hover .card-play-overlay,
.card-play-overlay.is-active {
    opacity: 1;
}

.audio-card-meta {
    flex: 1;
    min-width: 0;
}

.audio-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFF;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.audio-card-artist {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-card-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pill-tag {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-family: 'Space Grotesk', monospace;
}

.pill-format {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    font-weight: 700;
}

.audio-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-actions-left {
    display: flex;
    gap: 8px;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFF;
}

.btn-card-action.primary {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #F87171;
}

.btn-card-action.primary:hover {
    background: #EF4444;
    color: #FFF;
}

.btn-card-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-card-delete:hover {
    color: #EF4444;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xl);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Modal Component
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s var(--transition-fast);
}

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

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

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

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

.modal-icon {
    color: var(--accent-emerald);
}

.modal-header h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFF;
}

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

.btn-modal-close:hover {
    color: #FFF;
}

.stat-block {
    background: var(--bg-base);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-row strong {
    color: #FFF;
    font-family: 'Space Grotesk', monospace;
}

.stat-progress-group {
    margin-bottom: 16px;
}

.stat-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-bar-wrap {
    height: 7px;
    background: var(--bg-base);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.modal-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.modal-bar-fill.ram-fill {
    background: var(--accent-indigo);
}

.modal-cta-row {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 10px 18px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #FFF;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: #FFF;
    font-size: 0.88rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastIn 0.3s var(--transition-fast);
    transition: opacity 0.2s, transform 0.2s;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); }

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

/* Storage Quota Specific Styles */
.highlight-quota {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.quota-fill {
    background: linear-gradient(90deg, #10B981, #06B6D4);
}

.quota-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.35;
}

/* ==========================================================================
   Responsive Adaptations & Mobile Experience
   ========================================================================== */

@media (max-width: 768px) {
    .main-container {
        padding: 24px 16px 60px;
    }

    .hero-title {
        font-size: clamp(1.75rem, 5.5vw, 2.3rem);
        line-height: 1.2;
    }

    .hero-desc {
        font-size: 0.95rem;
        padding: 0 4px;
        margin-bottom: 24px;
    }

    .input-card {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .url-input-wrapper {
        padding: 6px 10px;
        gap: 8px;
    }

    .url-input-wrapper input {
        font-size: 16px; /* Prevents auto-zoom in Safari iOS */
        padding: 8px 2px;
    }

    .btn-input-action {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .options-strip {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 16px 0 20px;
        padding-top: 14px;
    }

    .format-chips {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .chip-content {
        justify-content: center;
        width: 100%;
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    .quality-select-wrap {
        width: 100%;
        justify-content: space-between;
        margin-top: 2px;
    }

    .quality-select-wrap select {
        flex: 1;
        height: 42px;
        font-size: 0.9rem;
    }

    .btn-primary-glow {
        height: 52px;
        font-size: 1rem;
        border-radius: var(--radius-md);
    }

    /* Task Card on Mobile */
    .task-card {
        padding: 16px;
        margin-top: 20px;
    }

    .task-card-inner {
        flex-direction: column;
        gap: 14px;
    }

    .task-thumb-wrap {
        width: 100%;
        max-height: 200px;
        aspect-ratio: 16/9;
    }

    .task-title {
        font-size: 0.98rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .task-metrics {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        background: rgba(0, 0, 0, 0.35);
        padding: 8px 6px;
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
    }

    .metric-item {
        align-items: center;
        text-align: center;
    }

    .metric-label {
        font-size: 0.65rem;
    }

    .metric-val {
        font-size: 0.85rem;
    }

    /* Player Card on Mobile */
    .player-card {
        padding: 18px 14px;
        margin-top: 24px;
        border-radius: 18px;
    }

    .player-content {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .player-left {
        width: 100%;
        gap: 12px;
    }

    .player-artwork {
        width: 54px;
        height: 54px;
    }

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

    .player-center {
        width: 100%;
        gap: 14px;
    }

    .player-controls {
        gap: 24px;
    }

    .btn-ctrl-play {
        width: 52px;
        height: 52px;
    }

    .player-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .btn-player-cta {
        width: 100%;
        justify-content: center;
        height: 48px;
        font-size: 0.95rem;
    }

    .btn-icon-subtle {
        width: 100%;
        height: 40px;
        border-radius: var(--radius-md);
    }

    /* Library Section on Mobile */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .section-controls {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .search-input-wrap {
        flex: 1;
        padding: 8px 14px;
    }

    .search-input-wrap input {
        width: 100%;
        font-size: 16px;
    }

    .library-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .audio-item-card {
        padding: 14px;
    }

    .card-thumb-wrap {
        width: 70px;
        height: 70px;
    }

    .audio-card-title {
        font-size: 0.88rem;
    }

    .audio-card-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .card-actions-left {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .btn-card-action {
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.78rem;
    }

    .btn-card-delete {
        width: 100%;
        justify-content: center;
        background: rgba(239, 68, 68, 0.08);
        border: 1px solid rgba(239, 68, 68, 0.15);
        border-radius: var(--radius-sm);
        padding: 8px;
        font-size: 0.78rem;
        gap: 6px;
    }

    .btn-card-delete::after {
        content: 'Excluir do Servidor';
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 14px;
    }

    .brand-text h1 {
        font-size: 1.05rem;
    }

    .vps-badge {
        display: none;
    }

    .stats-pill {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .stats-pill svg {
        width: 14px;
        height: 14px;
    }

    .btn-ghost-nav {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .hero-title {
        font-size: 1.65rem;
    }

    .format-chips {
        grid-template-columns: 1fr 1fr;
    }

    .card-actions-left {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
