.webp-to-jpg-converter {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.converter-header {
    text-align: center;
    margin-bottom: 40px;
}

.converter-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.converter-header .description {
    color: #7f8c8d;
    font-size: 1.1em;
    line-height: 1.6;
}

.converter-container {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    position: relative;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: #ff9a9e;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #fecfef;
    background: #ffeaa7;
    transform: scale(1.02);
}

.upload-area.file-selected {
    border-color: #74b9ff;
    background: #e8f6f3;
    padding: 30px 20px;
}

.upload-content .upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
    transition: all 0.3s ease;
}

.upload-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 600;
}

.upload-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.preview-note {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 10px;
    font-style: italic;
}

.file-preview {
    margin-top: 20px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.file-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.preview-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.browse-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

.file-info {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border: 1px solid #fd9644;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-info p {
    margin: 8px 0;
    color: #2c3e50;
    font-size: 0.95em;
}

.settings-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.quality-section, .background-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 25px;
    animation: slideDown 0.3s ease;
}

.quality-section h4, .background-section h4 {
    color: #856404;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
}

.quality-slider {
    width: 100%;
}

#qualityRange {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71);
    outline: none;
    -webkit-appearance: none;
}

#qualityRange::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2c3e50;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8em;
    color: #7f8c8d;
}

.quality-labels span:nth-child(2) {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1em;
}

.quality-description {
    text-align: center;
    margin-top: 10px;
    font-size: 0.85em;
    color: #636e72;
    font-style: italic;
}

.color-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.color-option:hover {
    background: rgba(255,255,255,0.5);
}

.color-option input[type="radio"] {
    display: none;
}

.color-option input[type="radio"]:checked + .color-box {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px #3498db;
}

.color-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.color-box.white {
    background: #ffffff;
    border-color: #bdc3c7;
}

.color-box.black {
    background: #000000;
    border-color: #2c3e50;
}

.color-box.transparent {
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), 
                linear-gradient(-45deg, #ccc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #ccc 75%), 
                linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.color-option span:last-child {
    font-size: 0.85em;
    color: #2c3e50;
    font-weight: 500;
}

.conversion-info {
    background: linear-gradient(135deg, #e8f6f3 0%, #dfe6e9 100%);
    border: 1px solid #74b9ff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
}

.conversion-info h4 {
    color: #0984e3;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
}

.conversion-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.conversion-info li {
    padding: 10px 15px;
    color: #0984e3;
    font-size: 0.95em;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.conversion-info li:hover {
    transform: translateX(5px);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.4);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 112, 85, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.4);
}

.btn-outline {
    background: transparent;
    color: #ff9a9e;
    border: 2px solid #ff9a9e;
}

.btn-outline:hover {
    background: #ff9a9e;
    color: white;
    transform: translateY(-3px);
}

.result-section {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #74b9ff;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.download-area h3 {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.download-area p {
    color: #155724;
    margin-bottom: 20px;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.file-size-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
}

.size-savings {
    color: #00b894;
    font-weight: bold;
    font-size: 1.1em;
}

.size-increase {
    color: #e17055;
    font-weight: bold;
    font-size: 1.1em;
}

.format-info {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    font-weight: 500;
    color: #2d3436;
    font-size: 0.95em;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff9a9e;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #ff9a9e;
    font-size: 1.1em;
    font-weight: 500;
}

.error-notification {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.error-icon {
    font-size: 1.2em;
}

.error-message {
    flex: 1;
    color: #721c24;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #721c24;
    padding: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close:hover {
    background: rgba(114, 28, 36, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .webp-to-jpg-converter {
        padding: 15px;
    }
    
    .converter-container {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .converter-header h2 {
        font-size: 2em;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-content .upload-icon {
        font-size: 3em;
    }
    
    .settings-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        min-width: auto;
        width: 100%;
    }
    
    .conversion-info ul {
        grid-template-columns: 1fr;
    }
    
    .quality-labels {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .color-options {
        gap: 10px;
    }
}