/* StreamVault — Luxury Dark Theme */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    --accent: #e22d2d;
    --accent-light: #ff6b6b;
    --accent-gradient: linear-gradient(135deg, #e22d2d 0%, #ff6b6b 100%);
    --success: #22c55e;
    --error: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(226, 45, 45, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 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;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

.bg-gradient {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(226, 45, 45, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.noise-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.main {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.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.1rem;
    max-width: 500px;
    margin: 0 auto;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
}

.extractor-section { margin-bottom: 32px; }

.input-card { padding: 32px; }

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

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

.url-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

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

.url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226, 45, 45, 0.1);
}

.extract-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

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

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

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

.spinner { animation: spin 1s linear infinite; }

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

.input-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 12px;
    padding-left: 4px;
}

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

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.badge {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-live {
    background: rgba(226, 45, 45, 0.15);
    color: var(--accent);
    animation: pulse 2s infinite;
}

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

.title-card {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.poster-wrapper {
    position: relative;
    width: 140px;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.poster-wrapper:hover .poster-img { transform: scale(1.05); }

.poster-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poster-wrapper:hover .poster-overlay { opacity: 1; }

.play-overlay-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.play-overlay-btn:hover { transform: scale(1.1); }

.title-info { flex: 1; }

.video-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.meta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.links-card { margin-bottom: 20px; }

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.card-title svg { color: var(--accent); }

.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: var(--transition);
}

.link-item:hover {
    border-color: rgba(226, 45, 45, 0.3);
    background: rgba(226, 45, 45, 0.05);
}

.link-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    flex-shrink: 0;
    min-width: 50px;
}

.link-url {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .title-card { flex-direction: column; text-align: center; }
    .poster-wrapper { width: 180px; height: 260px; }
    .hero-title { font-size: 2rem; }
    .input-wrapper { flex-direction: column; }
    .extract-btn { width: 100%; justify-content: center; }
    .header { padding: 16px 20px; }
    .nav { display: none; }
}

.player-section { margin-top: 32px; }

.player-card {
    padding: 0;
    overflow: hidden;
}

.video-container {
    position: relative;
    background: #000;
    aspect-ratio: 16/9;
}

video {
    width: 100%;
    height: 100%;
    display: block;
}

.player-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    color: var(--text-secondary);
}

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

.player-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.quality-selector select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

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

.error-section { margin-top: 32px; }

.error-card {
    text-align: center;
    padding: 48px 32px;
}

.error-icon { margin-bottom: 16px; }

.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 5;
}

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

.results-section .glass-card {
    animation: fadeInUp 0.5s ease forwards;
}

.results-section .glass-card:nth-child(2) { animation-delay: 0.1s; }
.results-section .glass-card:nth-child(3) { animation-delay: 0.2s; }
.results-section .glass-card:nth-child(4) { animation-delay: 0.3s; }
