:root {
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    /* Color Palette */
    --color-bg: #07080d;
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    
    --color-primary: #8b5cf6;
    --color-primary-glow: rgba(139, 92, 246, 0.3);
    --color-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #d946ef 100%);
    
    --color-border: rgba(255, 255, 255, 0.08);
    --color-card-bg: rgba(15, 17, 28, 0.65);
    
    /* Platform Colors */
    --color-spotify: #1db954;
    --color-youtube: #ef4444;
    --color-soundcloud: #ff5500;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Background Glowing Accents */
.background-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(80px);
    animation: floatGlow 15s infinite alternate ease-in-out;
}

.glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(80px);
    animation: floatGlow 20s infinite alternate-reverse ease-in-out;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 40px) scale(1.15); }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 680px;
    z-index: 10;
}

/* Header styling */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.logo svg {
    stroke: url(#logo-gradient); /* Note: standard gradient stroke support or we can color it directly */
    stroke: #8b5cf6;
    filter: drop-shadow(0px 4px 12px rgba(139, 92, 246, 0.4));
}

.version {
    font-size: 1.1rem;
    font-weight: 500;
    vertical-align: super;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-muted);
    -webkit-text-fill-color: var(--color-text-muted);
    margin-left: 0.25rem;
}

.tagline {
    font-family: var(--font-secondary);
    color: var(--color-text-muted);
    font-size: 0.975rem;
    font-weight: 400;
}

/* PWA Install Button */
.pwa-install-btn {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 999px;
    color: var(--color-primary);
    font-family: var(--font-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: fadeIn 0.4s ease;
    letter-spacing: 0.02em;
}

.pwa-install-btn:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

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

/* iOS install banner */
.ios-install-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 420px;
    background: rgba(15, 17, 28, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ios-install-banner.hidden { display: none; }

.ios-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.ios-banner-text {
    flex: 1;
    font-family: var(--font-secondary);
}

.ios-banner-text strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.2rem;
}

.ios-banner-text span {
    font-size: 0.77rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.ios-banner-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.ios-banner-close:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Spotify-Style Artist Profile Cards */
.quick-search-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.quick-search-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.spotify-artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 0.85rem;
}

.spotify-artist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.spotify-avatar-wrapper {
    position: relative;
    width: 86px;
    height: 86px;
    margin-bottom: 0.75rem;
}

.spotify-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.spotify-play-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
}

.spotify-artist-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.spotify-artist-card:hover .spotify-avatar-img {
    transform: scale(1.05);
}

.spotify-artist-card:hover .spotify-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.spotify-artist-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
}

.spotify-artist-name {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-artist-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.search-results-badge {
    background: rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--color-primary-light);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-left: auto;
}

/* Glassmorphism Card */
.main-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

/* Input Form & Wrapper */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-glow);
    background: rgba(255, 255, 255, 0.07);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    padding: 1.1rem 3rem 1.1rem 2.8rem;
    font-family: var(--font-primary);
    font-size: 1rem;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    padding: 4px;
    border-radius: 50%;
}

.clear-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

/* Search Button */
.search-btn {
    background: var(--color-gradient);
    border: none;
    outline: none;
    color: white;
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 1.1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    transition: var(--transition-smooth);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.45);
    filter: brightness(1.1);
}

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

/* Platform Badges */
.platforms-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.platform {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
}

.platform .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.platform.spotify .dot { background-color: var(--color-spotify); }
.platform.youtube .dot { background-color: var(--color-youtube); }
.platform.soundcloud .dot { background-color: var(--color-soundcloud); }
.platform.instagram .dot { background-color: #e1306c; }
.platform.tiktok .dot { background-color: #00f2fe; }
.platform.facebook .dot { background-color: #1877f2; }


/* Loader State */
.loader-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    gap: 1.5rem;
}

.spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.double-bounce1, .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--color-primary);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
    animation-delay: -1.0s;
    background-color: #d946ef;
}

@keyframes sk-bounce {
    0%, 100% { transform: scale(0.0); }
    50% { transform: scale(1.0); }
}

#loader-text {
    font-family: var(--font-secondary);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: pulseText 1.5s infinite alternate ease-in-out;
}

@keyframes pulseText {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Result Section */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Song card preview */
.song-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 560px) {
    .song-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cover-container {
        margin: 0 auto;
    }
}

.cover-container {
    width: 180px;
    height: 180px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#cover-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
}

.song-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#song-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

#song-artist {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.album-info {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 560px) {
    .album-info {
        justify-content: center;
    }
}

/* Download Button Container */
.download-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    outline: none;
    color: white;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
    transition: var(--transition-smooth);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.35);
    filter: brightness(1.08);
}

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

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

/* Audio Quality Selector */
.quality-selector-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.quality-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quality-pills {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 3px;
    gap: 3px;
}

.quality-pill {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quality-pill small {
    font-size: 0.7rem;
    opacity: 0.75;
    font-weight: 500;
}

.quality-pill:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.quality-pill.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.playlist-quality-container {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.playlist-download-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.download-zip-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25);
    flex: 1 1 180px;
}

.download-zip-btn:hover {
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.4);
}

.download-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text);
    box-shadow: none;
    flex: 1 1 150px;
}

.download-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Download Progress Section */
.download-progress-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-family: var(--font-secondary);
}

#progress-status {
    color: var(--color-text-muted);
}

#progress-percent {
    font-weight: 600;
    color: #10b981;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-note {
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Lyrics Accordion */
.lyrics-accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.lyrics-toggle-btn {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.lyrics-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.02);
}

.toggle-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toggle-title svg {
    color: var(--color-primary);
}

.chevron-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lyrics-accordion.open .chevron-icon {
    transform: rotate(180deg);
}

.lyrics-viewport {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lyrics-accordion.open .lyrics-viewport {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid var(--color-border);
}

#lyrics-text {
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 1.5rem;
    white-space: pre-wrap;
    color: rgba(255, 255, 255, 0.8);
}

/* Custom Scrollbar for lyrics */
.lyrics-viewport::-webkit-scrollbar {
    width: 6px;
}

.lyrics-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.lyrics-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.lyrics-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Error Section */
.error-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    animation: fadeIn 0.3s ease;
}

.error-icon {
    color: var(--color-youtube);
    display: flex;
    align-items: center;
}

#error-message {
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(239, 68, 68, 0.9);
}

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

/* Footer style */
.footer {
    text-align: center;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-family: var(--font-secondary);
}

.footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer a:hover {
    color: rgba(255, 255, 255, 0.6);
}

a.version {
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

a.version:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-main);
    -webkit-text-fill-color: var(--color-text-main);
}

/* Playlist Styling */
.playlist-card-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

.playlist-header {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.playlist-cover-container {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

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

.playlist-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.playlist-info h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.playlist-info h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.playlist-meta-info {
    font-size: 0.9rem;
    color: var(--color-spotify);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.playlist-progress-bar-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.playlist-tracks-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.playlist-tracks-header {
    display: grid;
    grid-template-columns: 1fr 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    padding: 0 0.5rem 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Custom Scrollbar for Playlist List */
.playlist-tracks-list::-webkit-scrollbar {
    width: 6px;
}

.playlist-tracks-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}

.playlist-tracks-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.playlist-tracks-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.playlist-track-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.playlist-track-row:hover {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
    transform: translateX(3px);
}

.playlist-track-row.selected {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.playlist-track-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.playlist-track-thumb-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.playlist-track-mini-cover {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.playlist-track-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-track-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-track-artist {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playlist buttons styling */
.playlist-track-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.playlist-track-preview-btn {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--color-primary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.playlist-track-preview-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.playlist-track-download-btn {
    justify-self: end;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-spotify);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.playlist-track-download-btn:hover {
    background: var(--color-spotify);
    color: black;
    border-color: var(--color-spotify);
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.3);
}

.playlist-track-download-btn.downloading {
    color: white !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    cursor: not-allowed;
    animation: pulse 1.5s infinite ease-in-out;
}

.playlist-track-download-btn.success {
    background: rgba(29, 185, 84, 0.1) !important;
    border-color: rgba(29, 185, 84, 0.2) !important;
    color: var(--color-spotify) !important;
    cursor: default;
}

.playlist-track-download-btn.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: var(--color-youtube) !important;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 580px) {
    .playlist-header {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
    }
    .playlist-info {
        align-items: center;
    }
}

/* Spinner Mini */
.spinner-mini {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin-mini 0.8s linear infinite;
}

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

/* ─── Install Guide Popup ─────────────────────────────────── */
.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.2s ease;
}

.guide-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 3rem);
    max-width: 400px;
    background: rgba(15, 17, 28, 0.96);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.1);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.guide-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.guide-header > div:nth-child(2) {
    flex: 1;
}

.guide-header strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.15rem;
}

.guide-header span {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.guide-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    line-height: 1;
}

.guide-close:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.guide-step strong {
    color: white;
}

.guide-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================
   SHARED NAVIGATION STYLES
   ========================================== */
.app-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.2rem;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.nav-item svg {
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover svg {
    opacity: 1;
}

/* SongFetch active tab theme */
.nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a855f7;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.song-filesize-text {
    font-family: var(--font-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.65rem;
    letter-spacing: 0.02em;
}


/* -------------------------------------------------
   Audio Preview Player Bar
   ------------------------------------------------- */

.audio-player-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    margin-top: 1.2rem;
    width: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-control-btn {
    background: var(--color-gradient);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.35);
    transition: var(--transition-smooth);
    flex-shrink: 0;
    position: relative;
}

.player-control-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.55);
}

.player-control-btn:active {
    transform: scale(0.95);
}

.player-control-btn .play-icon {
    margin-left: 2px; /* Visual centering for triangle */
}

.player-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

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

.player-progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

/* Custom range slider */
.player-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.player-slider::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 3px;
}

.player-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    margin-top: -4.5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.player-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.8);
}

.player-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.player-time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-family: var(--font-secondary);
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}

/* Playlist play button */
.playlist-track-play-btn {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--color-primary);
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.playlist-track-play-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
    transform: scale(1.1);
}

.playlist-track-play-btn.playing {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.playlist-track-play-btn .spinner-mini {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.playlist-track-play-btn.playing .spinner-mini {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}


/* -------------------------------------------------
   Responsive Layout – Mobile
   ------------------------------------------------- */

/* Prevent ANY horizontal overflow globally */
html {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.75rem;
        align-items: flex-start;
    }

    .container {
        padding: 0;
        max-width: 100%;
        width: 100%;
    }

    /* Make nav horizontally scrollable instead of overflowing */
    .app-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 6px;
    }
    .app-nav::-webkit-scrollbar {
        display: none;                  /* Chrome / Safari */
    }
    .app-nav .nav-item {
        flex-shrink: 0;
        font-size: 0.82rem;
        padding: 0.5rem 0.85rem;
    }

    /* Header */
    .header {
        margin-bottom: 1.5rem;
    }
    .logo svg {
        width: 28px;
        height: 28px;
    }
    .logo span {
        font-size: 1.4rem;
    }
    .tagline {
        font-size: 0.85rem;
    }

    /* Footer */
    .footer {
        font-size: 0.75rem;
    }

    /* Search / Input areas */
    .search-section input,
    .url-input-section input {
        font-size: 0.9rem;
    }
}

/* ──────────────────────────────────────────────────────────
   PHOTO SELECTION STYLES (Instagram / TikTok Carousels)
   ────────────────────────────────────────────────────────── */
.photo-selection-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: 1.1rem;
    animation: fadeIn 0.3s ease;
    text-align: left;
}

.photo-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.65rem;
}

.photo-selection-header .selector-label {
    margin-bottom: 0;
    font-size: 0.92rem;
}

.select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.select-all-label:hover {
    color: white;
}

/* Photo Grid Layout */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 0.25rem;
}

/* Custom Scrollbar for Photo Grid */
.photo-grid::-webkit-scrollbar {
    width: 6px;
}

.photo-grid::-webkit-scrollbar-track {
    background: transparent;
}

.photo-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.photo-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Card Styling */
.photo-grid-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.photo-grid-card:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.15);
}

.photo-grid-label {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.photo-grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

/* Checked styling using JS toggled classes or :has() */
.photo-grid-card:has(.photo-checkbox:checked) {
    border-color: #f43f5e;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

.photo-grid-card:has(.photo-checkbox:checked) img {
    filter: brightness(0.95);
}

/* Custom Checkbox UI */
.photo-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox-ui, .custom-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    z-index: 10;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Select all checkbox styling */
.select-all-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.select-all-label .custom-checkbox {
    position: relative;
    top: 0;
    left: 0;
    flex-shrink: 0;
}

.photo-checkbox:checked ~ .custom-checkbox-ui,
.select-all-label input:checked ~ .custom-checkbox {
    background: #f43f5e;
    border-color: #f43f5e;
}

.custom-checkbox-ui::after,
.select-all-label .custom-checkbox::after {
    content: "";
    position: absolute;
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
}

.photo-checkbox:checked ~ .custom-checkbox-ui::after,
.select-all-label input:checked ~ .custom-checkbox::after {
    display: block;
}

/* Index Badge */
.photo-index-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 5;
}

/* ==========================================
   CUSTOM QUALITY SELECT DROPDOWN
   ========================================== */
.quality-selector-container {
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.selector-label {
    font-family: var(--font-secondary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.8rem 1.15rem;
    color: #ffffff;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15);
}

.custom-select-trigger:focus-visible,
.custom-select-wrapper.open .custom-select-trigger {
    outline: none;
    border-color: #f43f5e;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.selected-quality-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.selected-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-quality-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.selected-size-pill {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quality-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block;
}

.badge-4k {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.badge-2k {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #ffffff;
}

.badge-hd {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
}

.badge-sd {
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.badge-audio {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.select-arrow {
    color: #94a3b8;
    transition: transform 0.25s ease, color 0.25s ease;
}

.custom-select-wrapper.open .select-arrow {
    color: #f43f5e;
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #0d0f18;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    z-index: 1000;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-options.hidden {
    display: none !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #e2e8f0;
    border: 1px solid transparent;
}

.custom-option-item:hover {
    background: rgba(244, 63, 94, 0.12);
    color: #ffffff;
    border-color: rgba(244, 63, 94, 0.2);
}

.custom-option-item.selected {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.35);
    color: #ffffff;
}

.option-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.option-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.option-size {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
}

.option-check {
    opacity: 0;
    color: #f43f5e;
    transition: opacity 0.15s ease;
}

.custom-option-item.selected .option-check {
    opacity: 1;
}

.custom-select-options::-webkit-scrollbar {
    width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
