:root {
    --primary: #ff4d4d;
    --secondary: #4d94ff;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #f59e0b;
}

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

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

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

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

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -5%;
    right: -5%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

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

.container {
    width: 90%;
    max-width: 900px;
    z-index: 10;
    padding: 2rem 0;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.search-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(77, 148, 255, 0.3);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.4);
}

.quality-msg {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: center;
}

/* Video Info Card */
.video-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.thumbnail-wrapper {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

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

.video-details h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.uploader {
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.description {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.download-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: auto;
}

.download-controls button, .download-controls select {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 150px;
}

#download-btn {
    flex: 1 1 100%;
}

select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    outline: none;
    cursor: pointer;
}

.primary-btn {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), #ff0000);
}

.secondary-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 1rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

@media (max-width: 768px) {
    .video-content {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    button {
        padding: 1rem;
    }
}

/* Utility */
.hidden {
    display: none !important;
}

/* Transcript Section */
.transcript-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.transcript-body {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: var(--secondary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Login Modal */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-card {
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.login-card h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.login-card p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.error-text {
    color: var(--primary);
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

#app-password {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: white;
    outline: none;
}

#login-btn {
    padding: 0 1.5rem;
}
