/* =======================================================================
   Simulateur Appariement (Matching)
   ======================================================================= */

.matching-simulator {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

.matching-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.matching-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    text-align: left;
}

.matching-nav-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.matching-nav-tabs span.active {
    font-weight: bold;
    color: #4a148c;
    border-bottom: 2px solid #4a148c;
    padding-bottom: 4px;
    font-size: 0.95rem;
}

.matching-intro {
    font-size: 0.92rem;
    color: #666;
    line-height: 1.4;
    max-width: 100%;
    margin: 0;
}

.matching-game-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 200px;
}

.matching-matched-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.matching-fused-row {
    display: flex;
    align-items: center;
    background: #e9ecef;
    border-radius: 40px;
    padding: 8px 18px;
    gap: 12px;
    min-height: 48px;
    width: 100%;
    color: #5e358e;
    font-weight: 600;
    font-size: 1rem;
    justify-content: space-between;
    transition: all 0.2s ease;
    animation: fadeInSlideUp 0.3s ease-out;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fused-left {
    flex: 1;
    text-align: center;
    padding-right: 15px;
    border-right: 2px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fused-right {
    flex: 1;
    text-align: center;
    padding-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fused-actions {
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.unlink-btn {
    background: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.unlink-btn:hover {
    background-color: #f8d7da;
    color: #dc3545;
    border-color: #dc3545;
}

.matching-fused-row.correct {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.matching-fused-row.wrong {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c6cb;
}

.matching-pools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

@media (max-width: 800px) {
    .matching-pools {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.matching-pool {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.matching-pool-item {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 10px;
    min-height: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.matching-pool-item:hover {
    background-color: #f8f9fa;
    border-color: #aeb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.matching-pool-item.selected {
    border-color: #6f42c1;
    background-color: #f3e5f5;
    color: #4a148c;
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.25);
    font-weight: 500;
}

.matching-pool-item.disabled {
    cursor: default;
    opacity: 0.5;
    background-color: #e9ecef;
    box-shadow: none;
    transform: none;
}

.matching-all-paired-msg {
    text-align: center;
    color: #adb5bd;
    font-style: italic;
    font-size: 0.9rem;
    margin: 20px 0;
}

.matching-action-bar {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
}

.matching-check-btn,
.matching-restart-btn {
    background-color: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
    transition: all 0.2s;
}

.matching-check-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.matching-check-btn:hover:not(:disabled),
.matching-restart-btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.25);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
