/* ============================================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================================ */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;
    --bg-glass: rgba(22, 22, 31, 0.85);

    --text-primary: #f0f0f5;
    --text-secondary: #9595a8;
    --text-muted: #5e5e72;

    --accent-primary: #FF0844;
    --accent-secondary: #FF6B6B;
    --accent-gradient: linear-gradient(135deg, #FF0844, #FF6B6B);
    --accent-glow: rgba(255, 8, 68, 0.25);

    --purple-accent: #8B5CF6;
    --blue-accent: #3B82F6;
    --green-accent: #10B981;
    --orange-accent: #F59E0B;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-normal: 0.35s var(--ease-out);
    --transition-slow: 0.5s var(--ease-out);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s var(--ease-out);
}

.login-logo {
    margin-bottom: 16px;
}

.login-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: all var(--transition-normal);
    margin-bottom: 12px;
}

.login-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.login-input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.login-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

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

.login-error {
    color: #f87171;
    font-size: 0.82rem;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius-sm);
}

.login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* App wrapper */
.app-wrapper {
    min-height: 100vh;
}

/* Logout button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.complete-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
/* ============================================================
   BACKGROUND EFFECTS
   ============================================================ */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -150px;
    right: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--purple-accent);
    bottom: -100px;
    left: -100px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: var(--blue-accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 18s ease-in-out infinite;
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, 80px); }
    66% { transform: translate(30px, -40px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, -60px); }
    66% { transform: translate(-40px, 30px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
}

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

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

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 40px;
    height: 40px;
}

.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
}

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

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s var(--ease-out);
}

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

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 8, 68, 0.1);
    border: 1px solid rgba(255, 8, 68, 0.2);
    border-radius: var(--radius-full);
    color: var(--accent-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 8, 68, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(255, 8, 68, 0); }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 12px;
}

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

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
    margin-bottom: 36px;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-container {
    max-width: 680px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 18px;
    transition: all var(--transition-normal);
    position: relative;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-icon svg {
    width: 20px;
    height: 20px;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    padding: 14px 12px;
    min-width: 0;
}

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

.search-btn {
    flex-shrink: 0;
    padding: 12px 28px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

.search-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   ERROR CONTAINER
   ============================================================ */
.error-container {
    max-width: 680px;
    margin: 0 auto 20px;
}

.error-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    color: #f87171;
    font-size: 0.9rem;
    animation: shakeX 0.5s var(--ease-out);
}

.error-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ============================================================
   VIDEO CARD
   ============================================================ */
.video-card {
    max-width: 800px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.5s var(--ease-out);
}

.video-card-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.video-thumbnail-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 360px;
    max-height: 240px;
    overflow: hidden;
}

.video-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.video-thumbnail-wrapper:hover .thumbnail-overlay {
    opacity: 1;
}

.video-info {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================================
   FORMAT SELECTION
   ============================================================ */
.format-section {
    margin-top: 4px;
}

.format-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.format-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.format-option {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.format-option.selected {
    border-color: var(--accent-primary);
    background: rgba(255, 8, 68, 0.1);
    color: var(--accent-secondary);
}

.format-option.audio-option {
    border-color: rgba(139, 92, 246, 0.3);
}

.format-option.audio-option.selected {
    border-color: var(--purple-accent);
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-accent);
}

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 4px;
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

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

/* ============================================================
   PROGRESS SECTION
   ============================================================ */
.progress-section {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    animation: fadeInUp 0.3s var(--ease-out);
}

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

.progress-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-secondary);
    font-variant-numeric: tabular-nums;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.progress-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   COMPLETE SECTION
   ============================================================ */
.complete-section {
    padding: 30px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    text-align: center;
    animation: fadeInUp 0.4s var(--ease-out);
}

.complete-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--green-accent);
    animation: scaleIn 0.5s var(--ease-out);
}

.complete-icon svg {
    width: 28px;
    height: 28px;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.complete-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-accent);
    margin-bottom: 6px;
}

.complete-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    word-break: break-all;
}

.save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: var(--green-accent);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.save-btn svg {
    width: 18px;
    height: 18px;
}

.save-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 50px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-card:nth-child(1) .feature-icon {
    background: rgba(255, 8, 68, 0.1);
    color: var(--accent-secondary);
}

.feature-card:nth-child(2) .feature-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-accent);
}

.feature-card:nth-child(3) .feature-icon {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-accent);
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================================
   LIBRARY TAB
   ============================================================ */
.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0 24px;
}

.library-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
}

.refresh-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.library-grid {
    display: grid;
    gap: 10px;
}

.library-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.library-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.library-item-icon.video-type {
    background: rgba(255, 8, 68, 0.1);
    color: var(--accent-secondary);
}

.library-item-icon.audio-type {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-accent);
}

.library-item-icon svg {
    width: 20px;
    height: 20px;
}

.library-item-info {
    flex: 1;
    min-width: 0;
}

.library-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.library-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

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

.lib-action-btn svg {
    width: 16px;
    height: 16px;
}

.lib-action-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.lib-action-btn.delete-btn:hover {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.library-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.library-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.library-empty h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.library-empty p {
    font-size: 0.9rem;
}

/* ============================================================
   STATUS BANNER
   ============================================================ */
.status-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    animation: slideUp 0.4s var(--ease-out);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    color: var(--orange-accent);
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.status-content a {
    color: var(--orange-accent);
    font-weight: 600;
    text-decoration: underline;
}

.setup-btn {
    padding: 6px 16px;
    background: var(--orange-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.setup-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.setup-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .video-card-inner {
        flex-direction: column;
    }

    .video-thumbnail-wrapper {
        width: 100%;
        max-height: 220px;
    }

    .features-section {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .search-box {
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }

    .search-icon {
        display: none;
    }

    #url-input {
        width: 100%;
        padding: 12px;
        text-align: center;
    }

    .search-btn {
        width: 100%;
    }

    .library-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .library-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .nav-btn span:not(.btn-text) {
        font-size: 0.8rem;
    }

    .status-content {
        white-space: normal;
        font-size: 0.78rem;
    }
}
