:root {
    --primary: #ff0000;
    --primary-hover: #cc0000;
    --primary-gradient: linear-gradient(135deg, #ff0000, #9d0000);
    --bg-dark: #0f0f0f;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animated Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #ff0000;
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #3a0000;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #6e0000;
    top: 40%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.1); }
}

/* App Container */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo-text span {
    font-weight: 300;
    opacity: 0.8;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Input Section */
.input-section {
    width: 100%;
}

.input-group {
    display: flex;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.15);
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.primary-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

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

/* Result Section */
.result-section {
    transition: var(--transition);
}

.hidden {
    display: none;
    opacity: 0;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info h2 {
    font-weight: 800;
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.video-author {
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-options h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.quality-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: var(--transition);
}

.quality-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.quality-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
}

.label {
    font-weight: 600;
    font-size: 0.95rem;
}

.size {
    font-size: 0.75rem;
    opacity: 0.6;
}

.download-btn {
    width: 100%;
    background: #fff;
    color: #000;
    padding: 1.2rem;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.download-btn:hover {
    background: #e0e0e0;
    transform: scale(1.02);
}

.download-btn.cancelling {
    background: #ff3333;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.download-btn.cancelling:hover {
    background: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

/* Progress Bar */
.progress-container {
    margin-top: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-panel {
        grid-template-columns: 1fr;
    }
    
    .app-container {
        padding: 2rem 1rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
}
