* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.upload-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #764ba2;
    background: #f0f0ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.upload-content p {
    color: #666;
    margin: 5px 0;
}

.btn-upload {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    margin: 15px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: auto;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
}

.settings-panel {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: none;
}

.settings-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.settings-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.setting-row label {
    min-width: 150px;
    font-weight: 500;
}

.setting-row input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    outline: none;
    -webkit-appearance: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.preview-section {
    display: none;
}

.preview-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.preview-box {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.preview-box h4 {
    text-align: center;
    margin-bottom: 10px;
    color: #555;
}

.preview-area {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 10px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-area img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 5px;
}

.file-info {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

.preview-arrow {
    font-size: 2rem;
    color: #667eea;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.stat {
    text-align: center;
}

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

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .preview-container {
        flex-direction: column;
    }
    
    .preview-arrow {
        transform: rotate(90deg);
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
