/* Sistema de Modales Global - Reutilizable */

/* Modal Overlay Base */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Contenido del Modal */
.modal-content {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    position: relative;
}

/* Header del Modal */
.modal-header {
    padding: 2rem;
    text-align: center;
    position: relative;
}

.modal-header.confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-header.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-header.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.modal-header.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-header.info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Icono del Modal */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    animation: scaleIn 0.4s ease-out 0.1s both;
}

.modal-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Cuerpo del Modal */
.modal-body {
    padding: 2rem;
}

.modal-message {
    text-align: center;
    color: #374151;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Detalles del Modal */
.modal-detail {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.modal-detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.modal-detail-item:last-child {
    margin-bottom: 0;
}

.modal-detail-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1rem;
    flex-shrink: 0;
}

.modal-detail-text {
    flex: 1;
}

.modal-detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-detail-value {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 600;
    margin-top: 0.125rem;
}

/* Acciones del Modal */
.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-btn-cancel:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.modal-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.modal-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.modal-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

.modal-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.modal-btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

.modal-btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.5);
}

/* Animación de Checkmark de Éxito */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.success-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px #10b981; }
}

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

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        border-radius: 1rem;
        margin: 1rem;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

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

    .modal-btn {
        width: 100%;
    }

    .modal-detail-item {
        gap: 0.5rem;
    }

    .modal-detail-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}
