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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

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

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Tool Section */
.tool-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.tool-section:hover {
    transform: translateY(-5px);
}

.tool-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Upload Area */
.upload-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 400px;
    background: rgba(102, 126, 234, 0.05);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.1);
    transform: scale(1.02);
}

.drop-zone i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 15px;
}

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

.browse-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: #764ba2;
}

/* Options */
.options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    font-weight: 600;
    color: #555;
}

.option-group select,
.option-group input[type="range"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.option-group select:focus,
.option-group input[type="range"]:focus {
    outline: none;
    border-color: #667eea;
}

#qualitySlider {
    width: 150px;
}

#qualityValue {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
}

/* Process Button */
.process-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* Result Section */
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result-section h2 {
    color: #28a745;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.result-item {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-item i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.result-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.result-item p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

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

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

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

    header h1 {
        font-size: 2rem;
    }

    .tool-section {
        padding: 20px;
    }

    .tool-section h2 {
        font-size: 1.5rem;
    }

    .drop-zone {
        min-width: unset;
        width: 100%;
        padding: 30px 20px;
    }

    .drop-zone i {
        font-size: 3rem;
    }

    .options {
        flex-direction: column;
        align-items: stretch;
    }

    .option-group {
        flex-direction: column;
        align-items: stretch;
    }

    .result-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .drop-zone i {
        font-size: 2.5rem;
    }

    .drop-zone p {
        font-size: 1rem;
    }

    .process-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Success Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeInUp 0.5s ease-out;
}

/* Error State */
.error {
    border-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1) !important;
}

.error i {
    color: #dc3545 !important;
}