/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1da1f2;
    --primary-dark: #1a91da;
    --secondary-color: #14171a;
    --background-color: #ffffff;
    --surface-color: #f5f8fa;
    --border-color: #e1e8ed;
    --text-primary: #14171a;
    --text-secondary: #657786;
    --success-color: #17bf63;
    --error-color: #e0245e;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    background: var(--surface-color);
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.language-switcher button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.language-switcher button:hover,
.language-switcher button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Download Page */
.download-container {
    max-width: 800px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* URL Input */
.url-input-container {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.url-input-wrapper {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.url-input-wrapper input[type="text"] {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.url-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* Quality Selector */
.quality-selector {
    margin: 1.5rem 0;
}

.quality-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.quality-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quality-option {
    display: none;
}

.quality-option + label {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quality-option:checked + label {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Video Preview */
.video-preview {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    display: none;
}

.video-preview.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.video-preview h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.video-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.video-info-item {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
}

.video-info-item strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.video-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--background-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Loading & States */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Message */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    display: none;
}

.success-message.show {
    display: block;
}

/* About Page */
.about-container {
    max-width: 900px;
    margin: 0 auto;
}

.about-hero {
    text-align: center;
    padding: 3rem 0;
}

.about-hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.about-hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.feature-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
}

.download-section {
    text-align: center;
    padding: 3rem 0;
    background: var(--surface-color);
    border-radius: var(--radius);
    margin-top: 2rem;
}

.download-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Footer */
footer {
    background: var(--surface-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .hero-section h2,
    .about-hero h2 {
        font-size: 1.75rem;
    }
    
    .url-input-wrapper {
        flex-direction: column;
    }
    
    .url-input-wrapper input[type="text"] {
        min-width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    main {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .language-switcher button {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
