:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

header p {
    font-size: 1.1rem;
    color: #666;
}

.main-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.upload-section {
    padding: 40px 20px;
    border-bottom: 1px solid #eee;
}

.upload-box {
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-box:hover {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

.upload-box i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-box h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-box p {
    margin: 10px 0;
    color: #666;
}

#fileInput {
    display: none;
}

.editor-section {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

@media (min-width: 992px) {
    .editor-section {
        flex-direction: row;
    }
}

.image-container {
    flex: 1;
    min-height: 400px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

@media (min-width: 992px) {
    .image-container {
        margin-bottom: 0;
        margin-right: 20px;
    }
}

#imageToCrop {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

#imageToCrop.hidden {
    display: none;
}

.controls {
    flex: 0 0 350px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
}

.control-group {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.control-group h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-item {
    margin-bottom: 15px;
}

.control-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.control-item input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.control-item select, 
.control-item input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

.control-item input[type="checkbox"] {
    margin-right: 8px;
}

.custom-ratio {
    display: flex;
    gap: 10px;
}

.custom-ratio .control-item {
    flex: 1;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--secondary-color);
}

.btn.secondary {
    background-color: #e9ecef;
    color: var(--dark-color);
}

.btn.secondary:hover {
    background-color: #dee2e6;
}

.btn.success {
    background-color: var(--success-color);
    color: white;
}

.btn.success:hover {
    background-color: #3aa8d8;
}

.result-section {
    padding: 30px;
    text-align: center;
}

.result-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.result-container {
    max-width: 800px;
    margin: 0 auto;
}

#resultCanvas {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* Drag and drop styles */
#dropArea.highlight {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.1);
}

/* Loading state */
.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}