:root {
    --bg-color: #0e0e10; /* Twitch Deep Dark */
    --surface-color: rgba(24, 24, 27, 0.8); /* Twitch Dark Gray */
    --primary-color: #9146FF; /* Twitch Neon Purple */
    --primary-hover: #a970ff;
    --text-main: #efeff1;
    --text-muted: #adadb8;
    --glass-border: rgba(145, 70, 255, 0.2);
    --glass-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.6);
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #0e0e10 0%, #18181b 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background animated elements */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 10s infinite ease-in-out alternate;
}

body::before {
    width: 300px;
    height: 300px;
    background: rgba(145, 70, 255, 0.15);
    top: 10%;
    left: 20%;
}

body::after {
    width: 400px;
    height: 400px;
    background: rgba(189, 130, 255, 0.12);
    bottom: 10%;
    right: 20%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

.lang-selector {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    gap: 15px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.lang-dropdown {
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.lang-dropdown:hover, .lang-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(145, 70, 255, 0.4);
}

.lang-dropdown option {
    background: var(--bg-color);
    color: var(--text-main);
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

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

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.hero .highlight {
    background: linear-gradient(90deg, #9146FF, #d4b3ff, #9146FF);
    background-size: 200% auto;
    animation: shine 3s linear infinite;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Glass panel */
.glass-panel {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
}

input[type="url"] {
    flex: 1;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="url"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(145, 70, 255, 0.4);
}

input[type="url"]::placeholder {
    color: #64748b;
}

button[type="submit"] {
    padding: 15px 35px;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 150px;
}

button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(145, 70, 255, 0.5);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Loader */
.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.status-msg {
    text-align: center;
    margin-top: 15px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.status-msg.error {
    color: var(--danger-color);
}

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

/* Results section */
.result {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.video-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.video-info img {
    width: 100%;
    max-width: 480px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.video-info img:hover {
    transform: scale(1.02);
}

#video-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.video-duration {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
    padding: 5px 12px;
    border-radius: 20px;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: rgba(145, 70, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(145, 70, 255, 0.2);
}

.download-btn .res {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.download-btn .size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.download-btn.audio {
    background: rgba(139, 92, 246, 0.05);
}
.download-btn.audio:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}
