* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e4e8;
}

h1 {
    color: #2563eb;
    font-weight: 600;
}

h3 {
    margin-bottom: 15px;
    color: #4b5563;
    font-weight: 500;
}

button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:hover {
    background-color: #1d4ed8;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

.history-controls {
    display: flex;
    gap: 10px;
}

.upload-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background-color: #f8fafc;
    transition: border-color 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #2563eb;
}

.upload-area i {
    font-size: 48px;
    color: #64748b;
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 15px;
    color: #64748b;
}

.upload-area .small {
    font-size: 0.8rem;
    color: #94a3b8;
}

.bulk-upload {
    flex: 1;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.progress-container {
    margin-top: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #2563eb;
    width: 0%;
    transition: width 0.3s ease;
}

#current-file {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-container {
    display: flex;
    gap: 20px;
}

.canvas-container {
    flex: 3;
    position: relative;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.editor-controls {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-row {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.scale-controls, .rotate-controls, .crop-controls, .convert-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

input[type="number"] {
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 100px;
}

.lock-aspect {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.quality-control {
    width: 100%;
    margin-bottom: 10px;
}

input[type="range"] {
    width: 100%;
    margin-top: 5px;
}

/* Crop overlay styles */
#crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.crop-handles {
    position: absolute;
    border: 2px dashed white;
    cursor: move;
}

.handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: white;
    border: 1px solid #2563eb;
}

.top-left {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.top-right {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

.top-middle {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bottom-middle {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.middle-left {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.middle-right {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.crop-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

/* Responsive styles */
@media (max-width: 992px) {
    .upload-container {
        flex-direction: column;
    }
    
    .editor-container {
        flex-direction: column;
    }
    
    .canvas-container {
        min-height: 300px;
    }
}

@media (max-width: 576px) {
    .rotate-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    button {
        width: 100%;
    }
}