/* =========================================================
   CUSTOM POPUP MODAL SYSTEM - EDULASI STUNTING BALITA
   ========================================================= */

@keyframes modalOverlayIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

@keyframes modalOverlayOut {
    0% {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    100% {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

@keyframes modalBoxSpringIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(24px);
    }
    65% {
        opacity: 1;
        transform: scale(1.02) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalBoxOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.85) translateY(16px);
    }
}

@keyframes modalIconPop {
    0% {
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.18) rotate(4deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    animation: modalOverlayIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-modal-overlay.closing {
    animation: modalOverlayOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.custom-modal-box {
    background: #ffffff;
    border-radius: 26px;
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 430px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0,0,0,0.1);
    border: 1px solid #E2E8F0;
    position: relative;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
    transform-origin: center center;
}

.custom-modal-overlay.active .custom-modal-box {
    animation: modalBoxSpringIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-modal-overlay.closing .custom-modal-box {
    animation: modalBoxOut 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.custom-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin: 0 auto 18px;
    border: 2px solid transparent;
}

.custom-modal-overlay.active .custom-modal-icon {
    animation: modalIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s backwards;
}

/* Modal Themes */
.custom-modal-icon.type-success {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    color: #059669;
    border-color: #A7F3D0;
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.2);
}

.custom-modal-icon.type-warning {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    color: #D97706;
    border-color: #FDE68A;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.2);
}

.custom-modal-icon.type-error {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    color: #DC2626;
    border-color: #FECACA;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.2);
}

.custom-modal-icon.type-score {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    color: #4F46E5;
    border-color: #C7D2FE;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}

.custom-modal-title {
    font-family: 'Sora', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.custom-modal-desc {
    color: #64748B;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 0 0 20px 0;
}

.custom-modal-details {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 22px;
    text-align: left;
}

.custom-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-modal-btn {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-modal-btn.btn-primary-emerald {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.28);
}
.custom-modal-btn.btn-primary-emerald:hover {
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.custom-modal-btn.btn-primary-indigo {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}
.custom-modal-btn.btn-primary-indigo:hover {
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.custom-modal-btn.btn-secondary {
    background: #F8FAFC;
    color: #475569;
    border: 1.5px solid #E2E8F0;
}
.custom-modal-btn.btn-secondary:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}
