/* css/webp-converter.css */

.converter-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    position: relative;
    z-index: 1;
}

.tool-section {
    padding: 2rem 0 4rem 0;
    position: relative;
    z-index: 10;
}

.tool-container {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Upload Section */
.upload-section {
    padding: 2rem;
    border-bottom: 1px solid #f3f4f6;
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
}

.upload-content {
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    color: #9ca3af;
    margin: 0 auto 1.5rem;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #667eea;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.supported-formats {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.format-tag {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Settings Section - Updated for full width slider */
.settings-section {
    padding: 2rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.settings-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Remove the max-width constraint and center alignment */
.settings-grid-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Removed: max-width: 400px; */
    /* Removed: margin-left: auto; */
    /* Removed: margin-right: auto; */
}

.setting-item {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.setting-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
    gap: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.setting-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.setting-range::-webkit-slider-thumb:hover {
    background: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.setting-range::-moz-range-thumb:hover {
    background: #5a6fd8;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.setting-value {
    font-weight: 600;
    color: #667eea;
    font-size: 0.875rem;
    min-width: 3rem;
    text-align: center;
}

.setting-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.convert-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.convert-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.convert-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* File List Section */
.file-list-section {
    padding: 2rem;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.download-all-button {
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.download-all-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Responsive file list */
.file-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* File Card */
.file-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.file-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

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

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

.file-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    word-break: break-word;
    font-size: 0.875rem;
}

.file-details {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.remove-file-btn {
    background: #ef4444;
    color: white;
    padding: 0.375rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background: #dc2626;
}

.remove-file-btn svg {
    width: 1rem;
    height: 1rem;
}

.progress-section {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-status {
    font-size: 0.75rem;
    color: #6b7280;
}

.progress-percentage {
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

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

.conversion-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-item {
    text-align: center;
}

.result-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.result-value.success {
    color: #10b981;
}

.download-button {
    width: 100%;
    background: #667eea;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.download-button:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.download-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* How It Works Section */
.how-it-works-section {
    padding: 4rem 0;
    background: #f9fafb;
}

.section-heading {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.step-item {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #6b7280;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-container {
    max-width: 3xl;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    transition: background 0.2s ease;
}

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

.faq-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f9fafb;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    padding-top: 0.5rem;
}

/* Size reduction indicator */
.size-reduction {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.size-reduction.excellent {
    background: #dcfce7;
    color: #166534;
}

.size-reduction.good {
    background: #fef3c7;
    color: #92400e;
}

.size-reduction.moderate {
    background: #dbeafe;
    color: #1e40af;
}

/* Success states */
.file-card.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.file-card.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Animation for upload area */
@keyframes uploadPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.upload-area.processing {
    animation: uploadPulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* No need to reset max-width for .settings-grid-single 
       since we removed the constraint */
    
    .conversion-results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .converter-hero {
        padding: 2rem 0;
    }
    
    .tool-section {
        padding: 1rem 0 2rem 0;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .upload-title {
        font-size: 1.25rem;
    }
    
    .settings-section,
    .file-list-section {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .file-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .file-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .file-actions {
        justify-content: flex-end;
        margin-left: 0;
    }
    
    .supported-formats {
        justify-content: center;
    }
    
    .conversion-results {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .result-item {
        text-align: left;
    }
    
    .setting-input-group {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .setting-value {
        text-align: left;
    }
}