/* ============================================
    MODAL SYSTEM STYLES - CLEAN VERSION (REVISED)
    ============================================ */

/* ==================== MODAL OVERLAY ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    animation: modalFadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==================== MODAL CONTAINER ==================== */
.modal-container {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


/* ==================== MODAL HEADER ==================== */
.modal-header {
    background: #2a2a2a;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* ==================== MODAL BODY ==================== */
.modal-body {
    padding: 30px 25px;
    color: #ffffff;
    background: #2a2a2a;
}

/* REVISI 1: Mengatasi Penataan Teks/Ikon */
.modal-message {
    display: flex;
    align-items: flex-start; /* Tetap flex-start agar ikon di atas */
    gap: 15px;
    font-family: 'Poppins', sans-serif;
}

/* ==================== MODAL ICON STYLES ==================== */
.modal-icon {
    font-size: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px currentColor);
    /* Menambahkan margin bawah pada ikon agar teks dimulai di bawah ikon (opsional, tergantung struktur HTML) */
    /* margin-top: 2px; */ 
}

.modal-icon.success {
    color: #ddff00;
    animation: iconSmoothBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
               iconGentlePulse 2.5s ease-in-out 0.7s infinite;
}

.modal-icon.error {
    color: #ef4444;
    animation: iconElasticShake 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.modal-icon.warning {
    color: #f59e0b;
    animation: iconSmoothBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
               iconSmoothSwing 2s ease-in-out 0.7s infinite;
    transform-origin: top center;
}

.modal-icon.info {
    color: #3b82f6;
    animation: iconSmoothPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* REVISI 2: Mengatasi Teks Modal yang Terlalu Tinggi */
.modal-text {
    flex: 1;
    line-height: 1.5; /* Sedikit dikurangi untuk kepadatan */
    font-size: 15px; /* Sedikit diperbesar agar lebih mudah dibaca */
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    /* KUNCI: Menambahkan margin-top agar teks sedikit turun dan tidak menempel di atas */
    margin-top: 2px; 
}

/* ==================== MODAL FOOTER ==================== */
.modal-footer {
    padding: 0 25px 25px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #2a2a2a;
}

/* ==================== MODAL BUTTONS ==================== */
.modal-btn {
    /* REVISI 3: Mengurangi ukuran tombol dan menghilangkan min-width yang kaku */
    padding: 8px 18px; 
    border: none;
    border-radius: 6px; /* Sedikit lebih kecil */
    font-size: 13px; /* Sedikit lebih kecil */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    min-width: 70px; /* Dipertahankan tapi dikurangi */
}

.modal-btn-primary {
    background: #ddff00 !important;
    color: #2a2a2a !important;
    box-shadow: 0 4px 15px rgba(221, 255, 0, 0.3);
}

.modal-btn-primary:hover {
    background: #c4e600 !important;
    box-shadow: 0 6px 20px rgba(221, 255, 0, 0.5);
    color: #2a2a2a !important;
    transform: translateY(-2px);
}

.modal-btn-secondary {
    background: #860000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn-secondary:hover {
    background: #d30000 !important;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ==================== ANIMATIONS ==================== */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes iconSmoothBounce {
    0% { transform: scale(0) translateY(30px) rotate(-10deg); opacity: 0; }
    40% { transform: scale(1.15) translateY(-8px) rotate(3deg); }
    60% { transform: scale(0.92) translateY(4px) rotate(-2deg); }
    80% { transform: scale(1.05) translateY(-2px) rotate(1deg); }
    100% { transform: scale(1) translateY(0) rotate(0deg); opacity: 1; }
}

@keyframes iconGentlePulse {
    0%, 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 2px 8px currentColor); }
    50% { transform: scale(1.08); opacity: 0.9; filter: drop-shadow(0 4px 12px currentColor); }
}

@keyframes iconElasticShake {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    10% { transform: translateX(-8px) rotate(-6deg) scale(1.05); }
    20% { transform: translateX(8px) rotate(6deg) scale(1.08); }
    30% { transform: translateX(-6px) rotate(-4deg) scale(1.06); }
    40% { transform: translateX(6px) rotate(4deg) scale(1.04); }
    50% { transform: translateX(-4px) rotate(-2deg) scale(1.02); }
    60% { transform: translateX(4px) rotate(2deg) scale(1.01); }
    70% { transform: translateX(-2px) rotate(-1deg) scale(1); }
    80% { transform: translateX(2px) rotate(1deg) scale(1); }
}

@keyframes iconSmoothSwing {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(10deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(6deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(2deg); }
    60% { transform: rotate(-1deg); }
}

@keyframes iconSmoothPop {
    0% { transform: scale(0) rotate(180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(-10deg); }
    70% { transform: scale(0.9) rotate(5deg); }
    85% { transform: scale(1.05) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ==================== RESPONSIVE ADAPTATION ==================== */
@media screen and (max-width: 768px) {
    .modal-container { max-width: 320px; }
    .modal-header h3 { font-size: 16px; }
    .modal-icon { font-size: 26px; }
    .modal-body { padding: 22px 18px; }
    .modal-text { font-size: 13px; }
    /* REVISI RESPONSIVE: Memastikan tombol tetap kompak di HP */
    .modal-btn { padding: 8px 15px; font-size: 13px; } 
}