/**
 * ==========================================================================
 * Sistem RAS Jember - Dedicated Modal Component Styles (modal.css)
 * ==========================================================================
 */

/* Modal Backdrop Overlay */
.ras-modal-backdrop,
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: pointer; /* Indikator klik luar untuk menutup */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ras-modal-backdrop.is-active,
.ras-modal-backdrop:not(.hidden),
.modal-backdrop-custom.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Dialog Card (Konten di dalam modal tidak boleh cursor pointer tutup) */
.ras-modal-card,
.modal-dialog-custom {
    background-color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
    width: 100%;
    max-width: 32rem; /* max-w-lg */
    overflow: hidden;
    cursor: default; /* Kembalikan cursor normal untuk isi modal */
    transform: scale(0.96) translateY(-4px);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease-in-out;
}

.ras-modal-backdrop.is-active .ras-modal-card,
.ras-modal-backdrop:not(.hidden) .ras-modal-card,
.modal-backdrop-custom.is-active .modal-dialog-custom {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.ras-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background-color: rgba(248, 250, 252, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Modal Body */
.ras-modal-body {
    padding: 1.25rem;
    max-height: calc(85vh - 130px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.ras-modal-body::-webkit-scrollbar {
    width: 6px;
}

.ras-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.ras-modal-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}

/* Modal Footer */
.ras-modal-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
}

/* Animation Utilities */
@keyframes rasModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-modal-in {
    animation: rasModalFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
