:root {
    --primary-color: #4a6bff;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --light-text: #777;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7ff;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

header p {
    color: var(--light-text);
    font-size: 1.1rem;
}

.btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.btn:hover {
    background-color: #3a5bef;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.upload-section {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.drop-area:hover {
    border-color: var(--primary-color);
}

.drop-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.drop-area h3 {
    margin-bottom: 10px;
    font-weight: 500;
}

.drop-area span {
    display: block;
    margin: 15px 0;
    color: var(--light-text);
}

.controls-section {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .preview-container {
        flex-direction: row;
    }
}

.image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 500;
    color: var(--text-color);
}

.control-group input[type="number"],
.control-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.control-group input[type="range"] {
    width: 100%;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-group input {
    width: auto;
}

.result-section {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .result-container {
        flex-direction: row;
    }
}

.original-info,
.resized-info {
    flex: 1;
}

.original-info h4,
.resized-info h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.original-info p,
.resized-info p {
    margin-bottom: 10px;
    color: var(--light-text);
}

.result-image-container {
    margin: 20px 0;
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 300px;
}

.result-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

footer {
    text-align: center;
    margin-top: auto;
    padding: 20px 0;
    color: var(--light-text);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .drop-area {
        padding: 30px 20px;
    }
    
    .controls-section, .result-section {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}