/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
}

.header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header h1 i {
    color: #e74c3c;
}

.subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Trust notice */
.trust-notice {
    background-color: #e8f4fc;
    border-left: 4px solid #3498db;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
}

.trust-notice i {
    color: #3498db;
    font-size: 1.1rem;
}

.trust-notice span {
    font-weight: 500;
    color: #2c3e50;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Upload section - SMALLER SIZE */
.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.upload-icon {
    font-size: 2.5rem;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.upload-area h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

#file-input {
    display: none;
}

.browse-btn {
    background: linear-gradient(to right, #3498db, #2c80b9);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
    margin: 0 auto;
}

.browse-btn:hover {
    background: linear-gradient(to right, #2980b9, #1c5a80);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.file-requirements {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #95a5a6;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #eaeaea;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-details i {
    font-size: 2rem;
    color: #e74c3c;
}

.file-text h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.file-text p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.clear-btn:hover {
    background-color: #c0392b;
}

/* Options section */
.options-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.mode-option {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option.active {
    border-color: #3498db;
    background-color: #f0f7ff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

.mode-option:hover:not(.active) {
    border-color: #bdc3c7;
    background-color: #f8f9fa;
}

.mode-option i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
}

.mode-option span {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.mode-description {
    color: #7f8c8d;
    font-size: 0.9rem;
}

#quality-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2c3e50;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#quality-select:focus {
    outline: none;
    border-color: #3498db;
}

.format-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95rem;
}

.format-info i {
    font-size: 1.5rem;
    color: #f39c12;
}

.format-info span {
    color: #2c3e50;
    font-weight: 500;
}

.convert-btn {
    width: 100%;
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.convert-btn:hover {
    background: linear-gradient(to right, #27ae60, #219653);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}

/* Progress section */
.progress-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Results section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-header h3 i {
    color: #2ecc71;
}

.download-btn {
    background: linear-gradient(to right, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.download-btn:hover {
    background: linear-gradient(to right, #8e44ad, #7d3c98);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(155, 89, 182, 0.4);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.image-preview {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.image-preview:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.image-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.image-preview p {
    padding: 10px;
    text-align: center;
    font-weight: 500;
    color: #2c3e50;
    background-color: white;
    font-size: 0.9rem;
}

.results-footer {
    display: flex;
    justify-content: center;
}

.reset-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Error section */
.error-section {
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.error-section h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-section p {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.footer strong {
    color: #2c3e50;
}

.copyright {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .upload-area {
        padding: 20px 15px;
        min-height: 160px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-area h3 {
        font-size: 1.2rem;
    }
    
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .image-preview img {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .upload-area {
        min-height: 150px;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .browse-btn, .convert-btn, .download-btn, .reset-btn {
        width: 100%;
        justify-content: center;
    }
    
    .file-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .file-details {
        flex-direction: column;
    }
}