/* Drag and Drop Styles for Matching Exercises */

.matching-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.matching-words {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.matching-word {
    background-color: var(--violet-50);
    border: 2px solid var(--violet-200);
    border-radius: 8px;
    padding: 1rem;
    width: 180px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.matching-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.word-content {
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.drop-zone {
    width: 100%;
    height: 100px;
    border: 2px dashed var(--violet-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--violet-50);
    transition: all 0.3s ease;
    min-height: 100px;
}

.drop-zone.drag-over {
    background-color: var(--violet-100);
    border-color: var(--violet-500);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(133, 123, 224, 0.3);
}

.matching-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
    background-color: var(--gray-100);
    border-radius: 8px;
}

.draggable-image {
    cursor: grab;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draggable-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--violet-300);
}

.draggable-image.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.draggable-image.hidden {
    display: none;
}

.draggable-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.draggable-image.placed {
    cursor: grab;
    width: 100%;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--violet-300);
    border-radius: 6px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.draggable-image.placed:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--violet-500);
}

.draggable-image.placed:hover::after {
    content: '↺';
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--violet-500);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.draggable-image.placed img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.draggable-image.placed.drop-complete {
    animation: dropComplete 0.4s ease-out;
}

@keyframes dropComplete {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.animated-clone {
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation classes */
@keyframes dropIn {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes correctMatch {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.correct-match {
    animation: correctMatch 1s ease-in-out;
    border-color: #34D399 !important;
    background-color: rgba(52, 211, 153, 0.1);
}

/* Responsive styles */
@media (max-width: 768px) {
    .matching-container {
        gap: 1rem;
    }
    
    .matching-word {
        width: 150px;
        min-height: 80px;
    }
    
    .drop-zone {
        height: 80px;
        min-height: 80px;
    }
    
    .draggable-image {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .matching-word {
        width: 120px;
    }
    
    .draggable-image {
        width: 80px;
        height: 80px;
    }
}
