@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* ---- Variabel Warna (Konsisten) ---- */
:root {
    --color-blue: #0D47A1;
    --color-gold: #d4af37;
    --color-bg: #f0f2f5;
    --color-chat-bg: #e5ddd5; /* Latar WA */
    --color-bubble-out: #dcf8c6; /* Bubble chat keluar (hijau) */
    --color-bubble-in: #ffffff;  /* Bubble chat masuk (putih) */
    --color-fail: #dc3545; /* Merah gagal */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    background-color: var(--color-blue);
    color: white;
    padding: 20px;
    text-align: center;
}

main {
    width: 100%;
    max-width: 400px; /* Lebar HP */
    padding: 20px;
}

/* ---- Kontainer HP ---- */
.simulator-container {
    background-color: var(--color-chat-bg);
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 700px; /* Tinggi HP */
    overflow: hidden;
}

/* ---- Header Chat WA ---- */
.chat-header {
    background-color: #075e54; /* Hijau WA */
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}
.back-arrow { font-size: 1.5rem; margin-right: 10px; }
.profile-pic { width: 40px; height: 40px; border-radius: 50%; margin-right: 10px; }
.chat-info strong { display: block; }
.chat-info span { font-size: 0.8rem; opacity: 0.8; }

/* ---- Jendela Chat ---- */
.chat-window {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto; /* Bisa di-scroll */
    display: flex;
    flex-direction: column;
}

/* ---- Bubble Chat ---- */
.chat-bubble {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    opacity: 0; /* Animasi muncul */
    transform: translateY(10px);
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bubble dari "Penipu" (Masuk) */
.chat-bubble.in {
    background-color: var(--color-bubble-in);
    align-self: flex-start;
}

/* Bubble dari "Anda" (Keluar) */
.chat-bubble.out {
    background-color: var(--color-bubble-out);
    align-self: flex-end;
}

/* Bubble khusus (Sistem/Peringatan) */
.chat-bubble.system {
    background-color: #fffbe5;
    color: #5f5f5f;
    font-style: italic;
    font-size: 0.9rem;
    align-self: center;
    text-align: center;
    max-width: 90%;
}

/* ---- Pilihan Jawaban ---- */
.response-options {
    background-color: #f0f0f0;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.response-options button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 20px;
    background-color: var(--color-blue);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.response-options button:hover {
    background-color: #0a3a80;
}

.response-options button.danger {
    background-color: var(--color-fail);
}
.response-options button.danger:hover {
    background-color: #b02a37;
}

/* ---- Modal (Copy dari Modul 2, tapi sedikit diubah) ---- */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-content {
    background-color: white; padding: 30px; border-radius: 8px;
    text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 400px;
}
.modal-content.fail h2 {
    color: var(--color-fail); /* Judul modal gagal jadi merah */
}
.modal-content h2 { color: var(--color-blue); margin-top: 0; }
.modal-button {
    background-color: var(--color-blue); color: white;
    padding: 10px 20px; border: none; border-radius: 5px;
    cursor: pointer; font-size: 1rem; font-weight: 700;
    margin-top: 10px; text-decoration: none;
}
#retry-btn { background-color: var(--color-gold); color: #333; }
