/* ============================================================
   Mamustopup / Tamudata — Premium Modal Popup System
   ============================================================ */

/* --- Overlay --- */
.mstu-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mstu-modal-overlay.mstu-active {
    opacity: 1;
    visibility: visible;
}

/* --- Card --- */
.mstu-modal-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 380px;
    padding: 40px 28px 32px;
    text-align: center;
    position: relative;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.mstu-modal-overlay.mstu-active .mstu-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* --- Icon Circle --- */
.mstu-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.mstu-modal-icon svg {
    width: 38px;
    height: 38px;
    stroke-width: 2.5;
    fill: none;
    stroke: #fff;
}

/* Success icon */
.mstu-modal-icon.mstu-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
    animation: mstu-icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

/* Error icon */
.mstu-modal-icon.mstu-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
    animation: mstu-icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

/* Info icon */
.mstu-modal-icon.mstu-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
    animation: mstu-icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

/* --- Ring pulse effect --- */
.mstu-modal-icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: mstu-ring-pulse 1s ease-out 0.5s both;
}

.mstu-modal-icon.mstu-success::after { border-color: rgba(34, 197, 94, 0.3); }
.mstu-modal-icon.mstu-error::after   { border-color: rgba(239, 68, 68, 0.3); }
.mstu-modal-icon.mstu-info::after    { border-color: rgba(59, 130, 246, 0.3); }

/* --- Title --- */
.mstu-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* --- Message --- */
.mstu-modal-message {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    margin: 0 0 28px;
    line-height: 1.6;
}

/* --- Button --- */
.mstu-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.mstu-modal-btn:hover {
    transform: translateY(-2px);
}

.mstu-modal-btn:active {
    transform: translateY(0);
}

/* Success button */
.mstu-modal-btn.mstu-btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

.mstu-modal-btn.mstu-btn-success:hover {
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.4);
}

/* Error button */
.mstu-modal-btn.mstu-btn-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.mstu-modal-btn.mstu-btn-error:hover {
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.4);
}

/* Primary / default button */
.mstu-modal-btn.mstu-btn-primary {
    background: linear-gradient(135deg, #1565C0, #1E88E5);
    color: #fff;
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.3);
}

.mstu-modal-btn.mstu-btn-primary:hover {
    box-shadow: 0 8px 28px rgba(21, 101, 192, 0.4);
}

/* --- Animations --- */
@keyframes mstu-icon-bounce {
    0%   { transform: scale(0); opacity: 0; }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes mstu-ring-pulse {
    0%   { transform: scale(0.8); opacity: 0; }
    50%  { opacity: 0.5; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* --- SVG checkmark draw animation --- */
.mstu-modal-icon svg .mstu-check-path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: mstu-draw-check 0.5s ease 0.5s forwards;
}

.mstu-modal-icon svg .mstu-cross-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: mstu-draw-check 0.4s ease 0.5s forwards;
}

@keyframes mstu-draw-check {
    to { stroke-dashoffset: 0; }
}

/* --- Body scroll lock --- */
body.mstu-modal-open {
    overflow: hidden !important;
}

/* --- Mobile responsive --- */
@media (max-width: 480px) {
    .mstu-modal-overlay {
        padding: 16px;
    }

    .mstu-modal-card {
        max-width: 100%;
        padding: 32px 20px 24px;
        border-radius: 14px;
    }

    .mstu-modal-icon {
        width: 66px;
        height: 66px;
        margin-bottom: 16px;
    }

    .mstu-modal-icon svg {
        width: 32px;
        height: 32px;
    }

    .mstu-modal-title {
        font-size: 20px;
    }

    .mstu-modal-message {
        font-size: 13px;
        margin-bottom: 24px;
    }

    .mstu-modal-btn {
        height: 46px;
        font-size: 14px;
    }
}
