/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 1rem;
    text-align: center;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.creator-link {
    color: #1da1f2;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.creator-link:hover {
    opacity: 0.8;
}

.repo-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #495057;
}

.repo-note a {
    color: #0d6efd;
    text-decoration: none;
}

.repo-note a:hover {
    text-decoration: underline;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.converter-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
}

/* Drop zone */
.drop-zone {
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    padding: 3rem 2rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #0d6efd;
    background-color: #f8f9ff;
}

.drop-content h2 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #495057;
}

.drop-content p {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.supported-formats {
    font-size: 0.85rem;
    color: #868e96;
}

.upload-icon {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Quality control */
.quality-control {
    margin: 2rem 0;
}

.quality-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #495057;
}

.quality-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    background: white;
    transition: border-color 0.2s ease;
}

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

.slider-container {
    margin: 1rem 0;
    padding: 0 1rem;
}

.quality-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    transition: background 0.2s ease;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: transform 0.1s ease;
}

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

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: transform 0.1s ease;
}

.quality-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.quality-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 2px 8px rgba(102, 126, 234, 0.3);
}

.presets-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    background: white;
    color: #495057;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 50px;
}

.preset-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.preset-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.quality-tooltip {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 1rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Status area */
.status-area {
    margin-top: 2rem;
    min-height: 60px;
}

.status-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-success {
    background-color: #d1edff;
    color: #0c5460;
    border: 1px solid #b6d7ff;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-processing {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.download-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.download-button:hover {
    background: #218838;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-size: 0.9rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

/* Progress indicator */
.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem 0;
}

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

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-content h2 {
        font-size: 1.25rem;
    }
    
    .quality-input {
        width: 50px;
        font-size: 0.9rem;
    }
    
    .slider-container {
        padding: 0 0.5rem;
    }
    
    .presets-container {
        gap: 0.375rem;
    }
    
    .preset-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
        min-width: 45px;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.processing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* File preview */
.file-preview {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.file-name {
    font-weight: 600;
    word-break: break-all;
}

.file-size {
    color: #6c757d;
}

/* Preview interface styles */
.preview-container {
    margin: 1rem 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #495057;
}

.clear-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-button:hover {
    background: #c82333;
}

.preview-file-list {
    max-height: 400px;
    overflow-y: auto;
}

.preview-file-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.preview-file-item:hover {
    background-color: #f8f9fa;
}

.preview-file-item:last-child {
    border-bottom: none;
}

.file-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.file-details .file-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.arrow {
    color: #28a745;
    font-weight: bold;
}

/* Estimation removed: .estimated-size no longer used */

.reduction {
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.reduction.positive {
    background-color: #d4edda;
    color: #155724;
}

.reduction.negative {
    background-color: #f8d7da;
    color: #721c24;
}

/* Estimation removed: .confidence-indicator no longer used */

.remove-file-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

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

.conversion-summary {
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat .label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stat .value {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.convert-all-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.convert-all-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for preview */
@media (max-width: 768px) {
    .preview-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .preview-file-item {
        padding: 1rem;
    }
    
    .file-thumbnail {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    
    .file-size-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .remove-file-btn {
        margin-left: 0.5rem;
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
}
