@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #ff0050;
    --secondary: #00f2ea;
    --bg-dark: #0a0a0c;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Animated Background */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0a0a0c 100%);
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.15;
    animation: move 20s infinite alternate;
}

.blob-1 { top: -100px; left: -100px; animation-delay: 0s; }
.blob-2 { bottom: -100px; right: -100px; animation-delay: -5s; }

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 100px) scale(1.2); }
}

/* Main Container */
.container {
    width: 90%;
    max-width: 600px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-dim);
    margin-bottom: 30px;
    font-weight: 300;
}

/* Input Area */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 18px 24px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 0, 80, 0.3);
}

button.download-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button.download-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

button.download-btn:active {
    transform: scale(0.98);
}

/* Result Section */
.result-card {
    margin-top: 30px;
    display: none;
    animation: slideUp 0.5s ease-out;
}

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

.video-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 9/16;
    max-height: 300px;
    background: #000;
}

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

.video-title {
    font-size: 0.9rem;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.opt-btn {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

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

.opt-btn.primary {
    background: var(--primary);
    border: none;
}

/* Loader */
.loader {
    display: none;
    margin: 20px auto;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-msg {
    color: #ff4d4d;
    margin-top: 15px;
    font-size: 0.85rem;
    display: none;
}
