/* ===================================
   CSS Reset & Base Styles - Modern Redesign
   =================================== */

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

:root {
    /* Modern Gradient Palette */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --primary-hover-gradient: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --primary-color: #4f46e5; /* Fallback */
    
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --error-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Modern Neutrals */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-on-primary: #ffffff;
    
    /* Backgrounds */
    --bg-body: #f3f4f6; /* Light Gray-Blue tint */
    --bg-card: rgba(255, 255, 255, 0.9); /* Glassmorphism base */
    --bg-input: #ffffff;
    
    --border-color: rgba(229, 231, 235, 0.8);
    
    /* Modern Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
    --spacing-2xl: 4rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Modern Rounding */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-pill: 9999px;
    
    --touch-target: 48px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    /* Subtle mesh gradient background pattern */
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   Container & Layout
   =================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   Header Styles (Glassmorphism)
   =================================== */

.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header .container {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: none; /* Hide on mobile to clean up */
}

@media (min-width: 768px) {
    .tagline { display: block; }
}

/* ===================================
   Language Switcher (Modern)
   =================================== */

.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.language-btn:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    display: none;
    overflow: hidden;
    z-index: 1000;
    animation: fadeInDown 0.2s ease-out;
}

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

.language-dropdown.show {
    display: block;
}

.language-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.language-option:hover {
    background: #f9fafb;
}

.language-option.active {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}

/* ===================================
   Main Content Area
   =================================== */

.main {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.content {
    flex: 1;
    width: 100%; /* Ensure full width */
}

/* ===================================
   Input Section (The Hero)
   =================================== */

.input-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl) var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    border: 1px solid white;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xl);
    letter-spacing: -0.03em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.video-form {
    max-width: 640px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

/* Modern Floating Input Style */
.form-input {
    width: 100%;
    height: 60px;
    padding: 0 24px;
    font-size: 1.125rem;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: white;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-label {
    display: none; /* Hiding label for cleaner look, relying on placeholder/aria */
}

/* Select Dropdown Modern */
.form-select {
    width: 100%;
    height: 50px;
    padding: 0 20px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ===================================
   Buttons (Gradient & Animated)
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 32px;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Primary Button */
.btn--primary {
    background: var(--primary-gradient);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn--primary:hover:not(:disabled) {
    background: var(--primary-hover-gradient);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(1px);
}

/* Download Button */
.btn--download {
    background: var(--success-gradient);
    color: white;
    width: 100%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn--download:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Spinner */
.spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn.loading .btn-text { display: none; }
.btn.loading .spinner { display: block; }

/* ===================================
   Messages (Alerts)
   =================================== */

.messages {
    margin-bottom: var(--spacing-lg);
}

.message {
    display: none;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-weight: 500;
    animation: slideUpFade 0.3s ease-out;
}

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

.message.show { display: block; }

.message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Queue Message Modern */
.message--queue {
    background: white;
    color: var(--text-primary);
    border: none;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 6px solid #6366f1;
}

.queue-icon { font-size: 2.5rem; margin-right: 1rem; }
.queue-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.queue-position strong { color: #4f46e5; }

/* ===================================
   Video Info Card (Modern)
   =================================== */

.video-info {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    animation: slideUpFade 0.5s ease-out;
}

.video-info__title-label {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.video-card__thumbnail {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.video-card__image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.video-card__thumbnail:hover .video-card__image {
    transform: scale(1.05);
}

.video-card__details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.video-card__meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    width: fit-content;
}

/* ===================================
   Footer (Clean)
   =================================== */

.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer__title {
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer__list, .footer__steps {
    padding-left: 0;
    list-style: none;
}

.footer__list li::before {
    content: "✓";
    color: #10b981;
    margin-right: 8px;
    font-weight: bold;
}

.footer__steps {
    counter-reset: step;
}

.footer__steps li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
}

.footer__steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    font-weight: bold;
}

/* ===================================
   Responsive Breakpoints
   =================================== */

@media (min-width: 768px) {
    .video-card {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .video-card__thumbnail {
        width: 360px;
        flex-shrink: 0;
    }
    
    .sidebar {
        width: 320px;
    }
    
    .content-wrapper {
        flex-direction: row;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .input-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .form-input {
        height: 50px;
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
    }
}

/* ===================================
   Ad Block (Clean Placeholder)
   =================================== */
.ad-block {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto var(--spacing-lg);
}

.ad-placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}
