/**
 * Static Image Resizer
 * Author: Ehsan Rostami (https://github.com/ehsan-rostami)
 * Copyright (c) 2025 Ehsan Rostami
 * Released under the MIT License.
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #1a252f;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 0;
}

p {
    line-height: 1.6;
}

section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.dimension-group {
    display: flex;
    gap: 20px;
}

.dimension-group .form-group {
    flex: 1;
}

input[type="range"] {
    width: 100%;
}

.file-extension {
    margin-left: 5px;
    color: #888;
}

#qualityValue {
    font-weight: bold;
    color: #007bff;
    margin-left: 10px;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.button-primary {
    background-color: #007bff;
    color: white;
}

.button-primary:disabled {
    background-color: #a0c7e4;
    cursor: not-allowed;
}

.button-primary:not(:disabled):hover {
    background-color: #0056b3;
}

.drop-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.drop-area.drag-over {
    border-color: #007bff;
    background-color: #e9f5ff;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
}

#previewThumbnail {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#imageInfo {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.process-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-top: 15px;
}

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

.output-section {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}
.output-section h2 {
    margin-top: 0;
    border-bottom: none;
    color: inherit;
}

[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 20px;
    }
    .dimension-group {
        flex-direction: column;
        gap: 0;
    }
}
