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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo .tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn:hover,
.lang-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Main Content */
.main {
    padding: 60px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 60px;
}

.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f7fafc;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.upload-sources {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.source-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.source-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.upload-hint {
    color: #718096;
    font-size: 0.9rem;
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.settings-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 30px;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.setting-group {
    background: #f7fafc;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1rem;
}

.frame-count-controls,
.quality-controls,
.duration-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.value-display {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.frame-count-labels,
.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #718096;
}

/* Preview Section */
.preview-section {
    margin-bottom: 30px;
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.video-preview {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    color: #718096;
    font-size: 1rem;
}

#preview-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* Action Buttons */
.action-buttons {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
}

/* Processing Section */
.processing-section {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.processing-animation {
    margin-bottom: 30px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.processing-subtitle {
    color: #718096;
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #718096;
    font-size: 0.9rem;
}

/* Result Section */
.result-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.result-subtitle {
    color: #718096;
    margin-bottom: 30px;
}

.gif-preview {
    margin-bottom: 30px;
}

.gif-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gif-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.info-value {
    color: #2d3748;
    font-weight: 500;
}

/* Features Section */
.features {
    background: white;
    padding: 80px 0;
    margin-top: 60px;
}

.features-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.feature-description {
    color: #718096;
    line-height: 1.6;
}

/* FAQ Section */
.faq {
    background: #f7fafc;
    padding: 80px 0;
}

.faq-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 50px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.faq-question {
    padding: 25px 30px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f7fafc;
}

.faq-answer {
    padding: 25px 30px;
    color: #718096;
    line-height: 1.6;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.footer-logo p {
    color: #a0aec0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-sources {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .main {
        padding: 40px 0;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .settings-section,
    .processing-section,
    .result-section {
        padding: 30px 20px;
    }
    
    .features {
        padding: 60px 0;
    }
    
    .faq {
        padding: 60px 0;
    }
}
