* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 1000px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 15px;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    max-width: 800px;
    margin: 0 auto 15px;
}

.language-selector {
    position: relative;
}

#languageSelect {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

#languageSelect option {
    background: #333;
    color: white;
}

header h1 {
    font-size: 2em;
    margin: 0;
    font-weight: 700;
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

.upload-section {
    padding: 30px 15px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.3em;
    color: #667eea;
    font-weight: 600;
}

#fileInput {
    display: none;
}

.settings-section {
    padding: 20px 15px;
    background: #f8f9ff;
    border-top: 1px solid #e0e0e0;
}

.settings-section h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.1em;
}

.format-options,
.quality-section,
.size-section {
    margin-bottom: 20px;
}

.format-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.format-btn {
    padding: 10px 25px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.format-btn:hover {
    background: #667eea;
    color: white;
}

.format-btn.active {
    background: #667eea;
    color: white;
}

.quality-presets {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.quality-preset {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quality-preset:hover {
    background: #667eea;
    color: white;
}

.quality-preset.active {
    background: #667eea;
    color: white;
}

.quality-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#qualitySlider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}

#qualitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#qualitySlider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#qualityValue {
    min-width: 50px;
    font-weight: 600;
    color: #667eea;
}

.size-options {
    display: flex;
    gap: 20px;
}

.size-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.size-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.size-option span {
    font-weight: 500;
    color: #555;
}

.results-section {
    padding: 20px 15px;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.preview-container h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.image-wrapper {
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.image-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.image-info p {
    margin: 5px 0;
    color: #555;
    font-size: 0.95em;
}

.comparison-slider {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.comparison-slider h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
    font-size: 1em;
}

.slider-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.slider-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.slider-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 3px solid white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.slider-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.slider-button {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

.download-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.download-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.reset-btn {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #667eea;
    color: white;
}

.features-section {
    padding: 30px 15px;
    background: #f8f9ff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.breadcrumb {
    padding: 10px 15px;
    background: #f8f9ff;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb nav ol {
    display: flex;
    list-style: none;
    gap: 10px;
    font-size: 0.9em;
}

.breadcrumb nav ol li {
    position: relative;
}

.breadcrumb nav ol li:not(:last-child)::after {
    content: '>';
    margin-left: 10px;
    color: #667eea;
}

.breadcrumb nav ol li a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb nav ol li a:hover {
    text-decoration: underline;
}

.breadcrumb nav ol li.current {
    color: #333;
    font-weight: 500;
}

.ad-section {
    padding: 20px 15px;
    background: #f8f9ff;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.faq-section {
    padding: 30px 15px;
    background: #f8f9ff;
    border-top: 1px solid #e0e0e0;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.faq-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.faq-item h3 {
    margin-bottom: 10px;
    color: #667eea;
    font-size: 1.1em;
}

.faq-item p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95em;
}

.feature-card {
    text-align: center;
    padding: 20px 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin-bottom: 8px;
    color: #333;
    font-size: 1.1em;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.9em;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 3em;
    }

    .upload-text {
        font-size: 1.1em;
    }

    .format-buttons,
    .quality-presets,
    .size-options {
        flex-direction: column;
        align-items: stretch;
    }

    .format-btn,
    .quality-preset {
        text-align: center;
    }

    .image-preview {
        grid-template-columns: 1fr;
    }

    .download-section {
        flex-direction: column;
        align-items: stretch;
    }

    .download-btn,
    .reset-btn {
        width: 100%;
    }
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
    font-size: 0.95em;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-message::before {
    content: "⚠️";
    font-size: 1.2em;
}

.warning-message a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.warning-message a:hover {
    color: #764ba2;
}