* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Upload Section */
.upload-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

.upload-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 2px dashed #3498db;
    transition: all 0.3s ease;
    max-width: 400px;
    width: 100%;
}

.upload-area:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #2980b9;
}

.upload-area.dragover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
    transform: scale(1.01);
}

.upload-area i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-area h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.upload-area p {
    margin-bottom: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.upload-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    font-weight: 500;
}

.upload-btn i {
    color: #f39c12;
    margin-right: 8px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.upload-btn i {
    margin-right: 10px;
}

/* Editor Section */
.editor-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.tool-group {
    display: flex;
    gap: 8px;
}

.tool-btn {
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7f8c8d;
}

.tool-btn:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.tool-btn i {
    font-size: 1.2rem;
}

.effects-group {
    display: flex;
    gap: 8px;
}

/* Effects Panel */
.effects-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.effect-slider {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.effect-slider:last-child {
    margin-bottom: 0;
}

.effect-slider label {
    min-width: 80px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #3498db;
    font-size: 0.9rem;
}

.resolution-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resolution-group label {
    font-weight: 600;
    color: #333;
}

.resolution-group select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
}

.custom-resolution {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-resolution input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
}

.custom-resolution span {
    font-weight: 600;
    color: #333;
}

/* Editor Workspace */
.editor-workspace {
    margin-bottom: 30px;
}

.canvas-container {
    position: relative;
    display: inline-block;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#imageCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.5);
    cursor: crosshair;
    border: 2px solid white;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    pointer-events: none;
}

.crop-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border: 2px dashed #fff;
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.crop-handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle-se { bottom: -6px; right: -6px; cursor: se-resize; }

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.action-btn.secondary {
    background: white;
    color: #3498db;
    border: 2px solid #3498db;
}

.action-btn.secondary:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .upload-section {
        padding-top: 20px;
    }
    
    .upload-area {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tool-group {
        justify-content: center;
    }
    
    .resolution-group {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.editor-section {
    animation: fadeIn 0.5s ease-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 