/* ============================================
   AVIF to WebP Converter - Styles
   Theme: Orange/Amber (#f39c12)
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #f39c12;
    --primary-hover: #e67e22;
    --primary-light: rgba(243, 156, 18, 0.1);
    --primary-gradient: linear-gradient(135deg, #f39c12, #e67e22);
    
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f1c40f;
    
    --text-dark: #2c3e50;
    --text-medium: #5a6c7d;
    --text-light: #95a5a6;
    
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e0e6ed;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #f5a623;
    --primary-hover: #f7b84b;
    --primary-light: rgba(245, 166, 35, 0.15);
    
    --text-dark: #f1f5f9;
    --text-medium: #94a3b8;
    --text-light: #64748b;
    
    --bg-light: #1e293b;
    --bg-card: #334155;
    --border-color: #475569;
}

/* Tool Container */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.tool-hero {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.tool-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.tool-icon {
    width: 40px;
    height: 40px;
    color: white;
}

.tool-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 12px;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
}

/* Upload Area */
.upload-container {
    margin-bottom: 24px;
}

.upload-area {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon-wrapper {
    background: var(--primary-light);
    transform: scale(1.05);
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
}

.upload-area h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.upload-area p {
    color: var(--text-medium);
    margin: 0 0 20px;
}

.upload-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 16px;
}

.upload-hint i {
    width: 14px;
    height: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

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

.btn-convert {
    background: var(--primary-gradient);
    color: white;
    padding: 16px 40px;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.3);
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

.btn-icon i {
    width: 18px;
    height: 18px;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.panel-header h3 i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

/* File List */
.file-list {
    padding: 16px 20px;
    max-height: 240px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-light);
}

.file-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
}

.file-remove i {
    width: 16px;
    height: 16px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 20px;
}

.setting-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.setting-header i {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.setting-header label {
    font-weight: 600;
    color: var(--text-dark);
}

/* Quality Slider */
.quality-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
}

.quality-value {
    min-width: 50px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.quality-presets {
    display: flex;
    gap: 8px;
}

.preset-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Method Options */
.method-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-option:hover {
    border-color: var(--primary-color);
}

.method-option input {
    display: none;
}

.method-option input:checked + .method-label {
    color: var(--primary-color);
}

.method-option:has(input:checked) {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.method-label {
    display: flex;
    flex-direction: column;
}

.method-label strong {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.method-label small {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Checkbox Options */
.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-option:hover {
    border-color: var(--primary-color);
}

.checkbox-option input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-option input:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-option span:last-child {
    color: var(--text-dark);
    font-weight: 500;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* Progress */
.progress-container {
    padding: 20px;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

.progress-text {
    font-size: 0.9rem;
    color: var(--text-medium);
}

/* Results Section */
.results-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--success-color);
    margin: 0;
}

.results-header h3 i {
    width: 20px;
    height: 20px;
}

.results-list {
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--border-color);
    flex-shrink: 0;
}

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

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.result-savings {
    color: var(--success-color);
    font-weight: 500;
}

.result-savings.increase {
    color: var(--warning-color);
}

.result-download {
    padding: 8px 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.result-download:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.result-download i {
    width: 16px;
    height: 16px;
}

.results-actions {
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* Related Tools */
.related-tools {
    margin-bottom: 30px;
}

.related-tools h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.related-tools h3 i {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.tool-card i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.tool-card span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Info Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 0 0 20px;
}

.info-card h2 i {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.step-content p {
    color: var(--text-medium);
    margin: 0;
    line-height: 1.5;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-item {
    text-align: center;
    padding: 16px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.feature-item h4 {
    color: var(--text-dark);
    margin: 0 0 8px;
    font-size: 1rem;
}

.feature-item p {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-item summary {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: var(--border-color);
}

.faq-item p {
    padding: 0 16px 14px;
    margin: 0;
    color: var(--text-medium);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: 15px;
    }
    
    .tool-hero {
        padding: 20px 15px;
    }
    
    .tool-hero h1 {
        font-size: 1.5rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .result-item {
        flex-wrap: wrap;
    }
    
    .result-download {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .quality-presets {
        flex-wrap: wrap;
    }
    
    .preset-btn {
        flex: 0 0 calc(50% - 4px);
    }
    
    .tools-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tool-card span {
        font-size: 0.8rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
