/* AVIF Converter - Estilos */
@import url('css-sprite.css');

/* Sobrescrever cores para tema indigo */
:root {
    --color-primary-avif: #6366F1;
    --color-secondary-avif: #818CF8;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-avif), var(--color-secondary-avif));
}

.btn-generate {
    background: linear-gradient(135deg, var(--color-primary-avif), var(--color-secondary-avif));
}

/* Settings Section */
.settings-section {
    margin-bottom: 40px;
}

.settings-card {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 25px;
}

.settings-card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--color-text);
}

.quality-control {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quality-control label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#qualityValue {
    color: var(--color-primary-avif);
    font-size: 18px;
}

.quality-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--color-border);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-avif);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--color-primary-avif);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-avif);
    cursor: pointer;
    border: none;
}

.quality-info {
    padding: 10px 15px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-text);
}

.quality-tip {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Restante dos estilos herdados do tema global ou sprite */
.upload-section {
    margin-bottom: 40px;
}

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

.upload-area:hover, .upload-area.dragover {
    border-color: var(--color-primary-avif);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.upload-limit {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}

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

.btn-danger {
    background: #EF4444;
}

.btn-success {
    background: #10B981;
}

.btn-back {
    display: inline-block;
    margin-top: 20px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.btn-back:hover {
    opacity: 1;
}

/* Images Grid */
.images-section {
    margin-bottom: 40px;
}

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

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.image-item {
    position: relative;
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #EF4444;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
}

.image-preview {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #f0f0f0;
}

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

.image-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.image-size {
    font-size: 11px;
    color: #666;
}

/* Results */
.result-header {
    background: #10B981;
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 25px 0;
    flex-wrap: wrap;
}

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

.stat-label {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.stat-savings .stat-value {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-preview-row {
    display: flex;
    gap: 10px;
    height: 100px;
}

.preview-box {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

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

.preview-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    text-align: center;
}

.result-details h4 {
    font-size: 14px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.savings-badge {
    background: #10B981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.btn-download-sm {
    width: 100%;
    padding: 8px;
    background: var(--color-primary-avif);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-download-sm:hover {
    background: var(--color-secondary-avif);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary-avif);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loadingText {
    font-size: 18px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.loading-progress {
    font-size: 14px;
    color: #cccccc;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .result-stats {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}
