/**
 * Styles pour le jeu de glisser-déposer Memoria
 */

.memoria-drag-drop-question {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.memoria-drag-drop-instruction {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.memoria-drag-drop-instruction h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.memoria-drag-drop-instruction p {
    margin: 0;
    color: #666;
    font-size: 1.1em;
}

.memoria-sequence-hint {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.memoria-drag-drop-game-area {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .memoria-drag-drop-game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Zone des éléments disponibles */
.memoria-drag-drop-items {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 600px;
    overflow-y: auto;
}

.memoria-drag-drop-items h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.memoria-items-container {
    display: grid;
    gap: 10px;
}

.memoria-drag-drop-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.memoria-drag-drop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.memoria-drag-drop-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.memoria-drag-drop-item.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
    z-index: 1000;
}

.memoria-drag-drop-item.hidden {
    display: none;
}

.memoria-drag-drop-item img {
    max-width: 40px;
    max-height: 40px;
    margin-right: 10px;
    border-radius: 4px;
    vertical-align: middle;
}

.memoria-item-text {
    font-weight: 600;
    font-size: 1em;
    display: block;
    margin-bottom: 5px;
}

.memoria-item-description {
    font-size: 0.85em;
    opacity: 0.9;
    font-style: italic;
}

/* Zones de drop */
.memoria-drag-drop-zones {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.memoria-drag-drop-zones h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.memoria-zones-container {
    display: grid;
    gap: 20px;
}

.memoria-drag-drop-zone {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fafafa;
}

.memoria-drag-drop-zone.drag-over {
    border-color: #28a745;
    background: #f0fff4;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.memoria-drag-drop-zone.zone-full {
    border-color: #ffc107;
    background: #fffbf0;
}

.memoria-drag-drop-zone.zone-invalid {
    border-color: #dc3545;
    background: #fff5f5;
    animation: shake 0.5s ease;
}

.memoria-zone-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.memoria-zone-header img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 4px;
    vertical-align: middle;
}

.memoria-zone-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    display: inline-block;
}

.memoria-zone-description {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.9em;
}

.memoria-zone-droparea {
    min-height: 80px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.memoria-zone-droparea.has-items {
    justify-content: flex-start;
    align-items: stretch;
}

.memoria-drop-hint {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.memoria-zone-droparea.has-items .memoria-drop-hint {
    display: none;
}

/* Éléments déposés */
.memoria-dropped-item {
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 5px 0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.memoria-dropped-item:hover {
    background: #218838;
    transform: translateX(5px);
}

.memoria-dropped-item.sequence-item {
    background: #17a2b8;
    position: relative;
}

.memoria-dropped-item.sequence-item::before {
    content: attr(data-sequence);
    position: absolute;
    left: -10px;
    top: -5px;
    background: #ffc107;
    color: #212529;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.memoria-dropped-item.sequence-item:hover {
    background: #138496;
}

.memoria-dropped-item-content {
    flex: 1;
}

.memoria-dropped-item-text {
    font-weight: 600;
    margin-bottom: 2px;
}

.memoria-dropped-item-description {
    font-size: 0.85em;
    opacity: 0.9;
}

.memoria-remove-item {
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.7;
    font-size: 1.2em;
    transition: opacity 0.3s ease;
}

.memoria-remove-item:hover {
    opacity: 1;
}

/* Contrôles */
.memoria-drag-drop-controls {
    text-align: center;
    margin-bottom: 20px;
}

.memoria-drag-drop-controls button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.memoria-drag-drop-controls button:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

.memoria-drag-drop-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.memoria-drag-drop-reset {
    background: #6c757d !important;
}

.memoria-drag-drop-reset:hover {
    background: #5a6268 !important;
}

/* Feedback */
.memoria-drag-drop-feedback {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.memoria-drag-drop-feedback.success {
    border-left: 4px solid #28a745;
    background: #d4edda;
}

.memoria-drag-drop-feedback.partial {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
}

.memoria-drag-drop-feedback.error {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
}

.memoria-feedback-score {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.memoria-feedback-details {
    margin-top: 15px;
}

.memoria-feedback-zone {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.5);
}

.memoria-feedback-zone-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.memoria-feedback-zone-items {
    display: grid;
    gap: 5px;
}

.memoria-feedback-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border-radius: 4px;
}

.memoria-feedback-item.correct {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.memoria-feedback-item.incorrect {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.memoria-feedback-icon {
    font-size: 1.1em;
}

/* Barre de progression */
.memoria-drag-drop-progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.memoria-drag-drop-progress-bar {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

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

.memoria-drag-drop-zone.drop-success {
    animation: dropSuccess 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.memoria-drag-drop-item.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* Indicateurs visuels */
.memoria-zone-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.memoria-zone-counter.full {
    background: #ffc107;
    color: #212529;
}

.memoria-zone-counter.over {
    background: #dc3545;
}

/* Responsive design */
@media (max-width: 480px) {
    .memoria-drag-drop-question {
        padding: 15px;
    }
    
    .memoria-drag-drop-item {
        padding: 12px;
    }
    
    .memoria-drag-drop-controls button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .memoria-zones-container {
        gap: 15px;
    }
    
    .memoria-zone-droparea {
        min-height: 60px;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .memoria-drag-drop-question {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .memoria-drag-drop-items,
    .memoria-drag-drop-zones {
        background: #34495e;
    }
    
    .memoria-drag-drop-zone {
        background: #3a4a5c;
        border-color: #4a5a6c;
    }
    
    .memoria-zone-header {
        background: #2c3e50;
        border-color: #4a5a6c;
    }
} 