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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    background: #2c3e50;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.toolbar label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.tool-section, .color-section, .size-section, .action-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tool Buttons */
.tool-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #4a90e2;
}

.tool-btn.active {
    background: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Color Picker */
#color-picker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 4px;
}

.color-preset {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s;
}

.color-preset:hover {
    transform: scale(1.1);
}

/* Size Control */
#brush-size {
    width: 100px;
}

#size-display {
    min-width: 40px;
    font-weight: 600;
}

/* Action Buttons */
.action-section button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-section button:hover {
    background: #2ecc71;
}

.action-section button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

#clear-btn {
    background: #e74c3c;
}

#clear-btn:hover {
    background: #c0392b;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: #ecf0f1;
}

#drawing-canvas {
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    cursor: crosshair;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#drawing-canvas.drawing {
    cursor: none;
}

#drawing-canvas.erasing {
    cursor: grab;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #34495e;
    color: #bdc3c7;
    font-size: 0.9rem;
}

#coordinates {
    font-family: monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .tool-section, .color-section, .size-section, .action-section {
        justify-content: center;
    }
    
    #drawing-canvas {
        max-width: 100%;
        max-height: 70vh;
    }
}

/* Visual Feedback */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.2s ease-in-out;
}