/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.65); /* Oscurece fondo para más contraste */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100; /* Asegurar z-index siempre por encima */
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal.active {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 1.25rem; /* 20px */
    padding: 2.5rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2), 0 0 20px rgba(5, 150, 105, 0.05); /* Sombra suave y profesional */
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50; /* Siempre clickeable */
}

.modal-close:hover {
    color: #0f172a;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Icon focus styles */
.input-with-icon:focus-within .input-icon {
    color: #059669; /* emerald-600 */
}

/* Animación */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Form Styles */
form{
    animation: fadeInUp 0.4s ease 0.1s backwards;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #13ec13;
    cursor: pointer;
}

/* Estilos para campos con error */
input.border-red-500,
textarea.border-red-500,
select.border-red-500 {
    animation: shake 0.3s ease;
}

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

/* Loading animación */
.animate-spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast/Alert styles */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* Scrollbar personalizado para modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #13ec13;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #10ad4a;
}

/* Responsivo */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
    }
}
