* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.control-section {
    padding: 30px 40px;
    border-bottom: 1px solid #eee;
}

.control-group {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.control-group h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.form-select, .form-input {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e1e8ed;
    outline: none;
    margin-top: 10px;
}

.slider-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1em;
}

.control-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-operation {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.btn-operation:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.canvas-section {
    padding: 30px 40px;
}

.canvas-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2em;
}

.canvas-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
    display: flex;
    justify-content: center;
    overflow: auto;
    margin-bottom: 20px;
}

#rasterCanvas {
    background: white;
    border: 2px solid #2c3e50;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: crosshair;
}

.performance-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .control-section,
    .canvas-section {
        padding: 20px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .performance-info {
        grid-template-columns: 1fr;
    }

    .canvas-container {
        padding: 10px;
    }

    #rasterCanvas {
        max-width: 100%;
        height: auto;
    }
}

.notification {
    color: white;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #27ae60;
    border-left: 4px solid #2ecc71;
}

.notification.error {
    background: #e74c3c;
    border-left: 4px solid #c0392b;
}

.notification.warning {
    background: #f39c12;
    border-left: 4px solid #e67e22;
}

.notification.info {
    background: #3498db;
    border-left: 4px solid #2980b9;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.control-item.full-width {
    grid-column: 1 / -1;
}

.coordinates-row {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 10px;
}

@media (max-width: 768px) {
    .coordinates-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .control-item.full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .coordinates-row {
        grid-template-columns: 1fr;
    }
}