/* Overlay de la modale */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

/* Conteneur de la modale - Style Nintendo */
.modal {
    background: var(--red-nintendo);
    border-radius: 0px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: slideIn 0.3s ease;
}

/* Variantes de thème */
.modal--primary { background: var(--red-nintendo); }
.modal--danger { background: var(--red-nintendo); }
.modal--success { background: #28a745; }
.modal--info { background: #17a2b8; }

.modal-title-icon { display:inline-flex; align-items:center; justify-content:center; margin-right:0.5rem; }
.modal-title-icon svg { display:block; stroke: #fff; }

/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Body */
.modal-body {
    padding: 1.5rem;
    color: #fff;
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer button {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-cancel {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-cancel:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Bouton de confirmation */
.modal-confirm {
    background: #fff;
    color: var(--red-nintendo);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.modal-confirm:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

/* Toutes les variantes identiques */
.modal-confirm.btn-primary {
    background: #fff;
    color: var(--red-nintendo);
}

.modal-confirm.btn-primary:hover {
    background: #f5f5f5;
}

.modal-confirm.btn-danger {
    background: #fff;
    color: var(--red-nintendo);
}

.modal-confirm.btn-danger:hover {
    background: #f5f5f5;
}

/* Variante succès */
.modal-confirm.btn-success {
    background: #fff;
    color: #28a745;
}
.modal-confirm.btn-success:hover {
    background: #f5f5f5;
}

/* Variante info */
.modal-confirm.btn-info {
    background: #fff;
    color: #17a2b8;
}
.modal-confirm.btn-info:hover {
    background: #f5f5f5;
}

/* Focus accessible */
.modal-footer button:focus-visible, .modal-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .modal {
        max-width: 95%;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal {
        background: var(--red-nintendo);
    }

    .modal--primary { background: var(--red-nintendo); }
    .modal--danger { background: var(--red-dark); }
    .modal--success { background: #28a745; }
    .modal--info { background: #17a2b8; }

    .modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}
