/* Styles pour l'atelier de dessin interactif */

.drawing-workshop {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.drawing-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.drawing-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.drawing-header p {
    margin: 10px 0 0;
    opacity: 0.9;
    font-size: 16px;
}

.drawing-workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.canvas-area {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#drawing-canvas {
    border: 3px solid #667eea;
    border-radius: 15px;
    cursor: crosshair;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

#drawing-canvas.select-mode {
    cursor: pointer;
}

.canvas-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.controls-panel {
    width: 280px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
}

.control-section {
    margin-bottom: 25px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-section h3::before {
    content: "🎨";
    font-size: 20px;
}

.control-section.tools h3::before {
    content: "🛠️";
}

.control-section.colors h3::before {
    content: "🌈";
}

.control-section.presets h3::before {
    content: "✨";
}

.control-section.actions h3::before {
    content: "⚡";
}

/* Boutons d'outils */
.tool-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tool-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.tool-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.tool-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Palette de couleurs */
.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.color-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Contrôle de taille */
.size-control {
    margin-bottom: 15px;
}

.size-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#size-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

#size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.size-display {
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Éléments prédéfinis */
.preset-category {
    margin-bottom: 15px;
}

.preset-category h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
    font-weight: 600;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.preset-btn {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.05);
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.clear {
    background: #ff6b6b;
    color: white;
}

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

.action-btn.delete {
    background: #ffa726;
    color: white;
}

.action-btn.delete:hover {
    background: #ff9800;
    transform: translateY(-2px);
}

.action-btn.save {
    background: #4caf50;
    color: white;
}

.action-btn.save:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Instructions */
.drawing-instructions {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.drawing-instructions h4 {
    margin: 0 0 10px;
    color: #667eea;
    font-size: 16px;
}

.drawing-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.drawing-instructions li {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .drawing-workspace {
        flex-direction: column;
        padding: 15px;
    }
    
    .controls-panel {
        width: 100%;
        order: -1;
    }
    
    #drawing-canvas {
        width: 100%;
        max-width: 100%;
    }
    
    .color-palette {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .tool-buttons {
        flex-direction: column;
    }
    
    .drawing-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .drawing-workshop {
        padding: 10px;
    }
    
    .drawing-container {
        border-radius: 15px;
    }
    
    .drawing-header {
        padding: 15px;
    }
    
    .drawing-workspace {
        padding: 10px;
    }
    
    .controls-panel {
        padding: 15px;
    }
    
    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .color-btn {
        width: 35px;
        height: 35px;
    }
}

/* Animations */
@keyframes drawingReady {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.drawing-container.ready {
    animation: drawingReady 0.5s ease;
}

/* États de sélection */
.element-selected {
    filter: drop-shadow(0 0 10px #007bff);
}

/* Curseurs personnalisés */
.canvas-area.brush-mode #drawing-canvas {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="black" stroke-width="2"/></svg>') 10 10, crosshair;
}

.canvas-area.select-mode #drawing-canvas {
    cursor: pointer;
}



/* Styles spéciaux pour les arrière-plans */
.backgrounds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.background-btn {
    height: 50px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.background-btn.active {
    border: 3px solid #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    text-shadow: none;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: scale(1.08);
}

/* Animation pour les changements d'arrière-plan */
@keyframes background-change {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.drawing-container.background-changing {
    animation: background-change 0.5s ease;
}

/* Indicateur d'arrière-plan actif */
.background-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Styles pour les patterns */
.pattern-stars {
    background: linear-gradient(45deg, #E6F3FF 25%, transparent 25%), 
                linear-gradient(-45deg, #E6F3FF 25%, transparent 25%);
    background-size: 20px 20px;
}

.pattern-clouds {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
}

/* Amélioration des boutons de preset */
.preset-btn {
    transition: all 0.3s ease;
    position: relative;
}

.preset-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.preset-btn:hover::after {
    opacity: 1;
}

/* Instructions mises à jour */
.drawing-instructions {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.drawing-instructions h4 {
    margin: 0 0 10px;
    color: #667eea;
    font-size: 16px;
}

.drawing-instructions ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.drawing-instructions li {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Responsive pour les arrière-plans */
@media (max-width: 768px) {
    .backgrounds-grid {
        grid-template-columns: 1fr;
    }
    
    .background-btn {
        height: 45px;
        font-size: 11px;
    }
}

/* Animation de succès pour l'upload */
@keyframes upload-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: #4caf50; }
    100% { transform: scale(1); }
}

.upload-btn.success {
    animation: upload-success 0.6s ease;
}

