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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

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

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
}

/* Upload Section */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8f0fe;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.browse-text {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
}

.supported-formats {
    margin-top: 15px;
}

.supported-formats small {
    color: #888;
    font-size: 0.9rem;
}

/* Processing Section */
.processing-section {
    animation: fadeIn 0.5s ease-in;
}

.image-preview-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
}

.preview-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.preview-card h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.image-preview {
    width: 100%;
    height: 250px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #fff;
    border: 2px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.placeholder {
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.conversion-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 130px;
}

.conversion-arrow i {
    font-size: 2rem;
    color: #667eea;
    background: white;
    padding: 15px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.image-info {
    text-align: left;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #666;
}

.value {
    color: #333;
    font-weight: 500;
}

/* Conversion Controls */
.conversion-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: end;
    margin-bottom: 30px;
}

.format-selector,
.quality-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-selector label,
.quality-selector label {
    font-weight: 600;
    color: #333;
}

.format-selector select,
.quality-selector input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.format-selector select:focus,
.quality-selector input:focus {
    outline: none;
    border-color: #667eea;
}

.quality-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quality-selector input[type="range"] {
    width: 100%;
}

#qualityValue {
    font-weight: 600;
    color: #667eea;
    align-self: center;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress Bar */
.progress-container {
    margin-top: 30px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message i {
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 25px;
    }

    .image-preview-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .conversion-arrow {
        margin-top: 0;
        transform: rotate(90deg);
    }

    .conversion-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .upload-content h3 {
        font-size: 1.3rem;
    }

    .image-preview {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .upload-content i {
        font-size: 3rem;
    }

    .upload-content h3 {
        font-size: 1.2rem;
    }

    .image-preview {
        height: 150px;
    }

    .preview-card {
        padding: 20px;
    }
}
