:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    font-size:20px;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5eb;
}

.app-header h1 {
    font-size: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn.small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--secondary-color);
}

.btn.success {
    background-color: var(--success-color);
    color: white;
}

.btn.success:hover {
    background-color: #38b6db;
}

.btn.danger {
    background-color: var(--danger-color);
    color: white;
}

.btn.danger:hover {
    background-color: #e5177b;
}

.btn.warning {
    background-color: var(--warning-color);
    color: white;
}

.btn.warning:hover {
    background-color: #e68a19;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.editor-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.toolbox {
    flex: 0 0 300px;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    overflow-y: auto;
    max-height: 80vh;
}

.tool-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5eb;
}

.tool-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tool-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-control {
    margin-bottom: 15px;
}

.tool-control label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--gray-color);
}

.tool-control input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e1e5eb;
    outline: none;
}

.tool-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.tool-control span {
    display: inline-block;
    font-size: 12px;
    color: var(--gray-color);
    width: 30px;
    text-align: right;
}

.canvas-container {
    flex: 1;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 500px;
}

.image-placeholder {
    text-align: center;
    color: var(--gray-color);
    padding: 30px;
}

.image-placeholder i {
    font-size: 60px;
    margin-bottom: 15px;
    color: #e1e5eb;
}

.image-placeholder p {
    font-size: 16px;
}

canvas {
    max-width: 100%;
    max-height: 70vh;
    display: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.filter-option {
    padding: 8px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-option:hover {
    background-color: #e9ecef;
}

.filter-option.active {
    background-color: var(--primary-color);
    color: white;
}

.presets-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
    margin-top: 20px;
}

.presets-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.preset-option {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.preset-option:hover {
    transform: translateY(-3px);
}

.preset-thumb {
    width: 100%;
    height: 80px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    box-shadow: var(--box-shadow);
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.crop-area {
    border: 2px dashed white;
    position: relative;
    cursor: move;
}

.crop-area::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    cursor: nwse-resize;
}

.crop-area::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    cursor: nwse-resize;
}

.crop-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

/* Responsive styles */
@media (max-width: 992px) {
    .editor-container {
        flex-direction: column;
    }
    
    .toolbox {
        flex: 1;
        width: 100%;
        max-height: none;
    }
    
    .filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 576px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preset-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}