/* Variabel Warna Biar Gampang Diubah */
:root {
    --pink-dark: #ff69b4;
    --pink-light: #ffb6c1;
    --pink-soft: #fff0f5;
    --white: #ffffff;
    --gray: #888;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--pink-soft);
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    color: #444;
}

/* --- Animasi Bunga Jatuh --- */
.flower {
    position: fixed;
    top: -10%;
    z-index: 999;
    user-select: none;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(110vh) rotate(360deg); }
}

/* --- Layout Utama --- */
.container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

h1 { color: var(--pink-dark); margin-bottom: 5px; font-weight: 600; }
.subtitle { font-size: 0.9em; color: var(--gray); margin-bottom: 25px; }

/* --- Kalender Grid --- */
.calendar-card {
    background: var(--white);
    padding: 25px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.1);
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.day-btn {
    aspect-ratio: 1;
    border: 2px dashed var(--pink-light);
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--pink-light);
}

.day-btn.checked {
    background: var(--pink-dark);
    border-color: var(--pink-dark);
    color: var(--white);
    border-style: solid;
    transform: scale(0.95);
}

.day-btn.checked::after {
    content: '✓';
    font-size: 1.2em;
}

.reset-area { margin-top: 20px; }
.btn-reset {
    background: #f0f0f0;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.75em;
    color: #999;
    cursor: pointer;
}

/* --- Floating Chatbot --- */
#chat-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: var(--pink-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
    cursor: pointer;
    z-index: 1001;
    font-size: 24px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-launcher:hover { transform: scale(1.1); }

#chat-container {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 350px;
    max-width: calc(100vw - 50px);
    height: 450px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none; /* Dikontrol JS */
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.chat-header { 
    background: var(--pink-dark); 
    color: var(--white); 
    padding: 15px; 
    font-weight: 600;
    font-size: 0.9em;
}

.chat-window { 
    flex: 1; 
    padding: 15px; 
    overflow-y: auto; 
    background: #fffafa; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.msg { 
    padding: 10px 14px; 
    border-radius: 15px; 
    font-size: 0.85em; 
    max-width: 85%;
    line-height: 1.4;
}

.msg.dzaki { 
    background: var(--pink-soft); 
    color: #d02090; 
    align-self: flex-start; 
    border-bottom-left-radius: 2px;
}

.msg.user { 
    background: #e4e4e4; 
    color: #333;
    align-self: flex-end; 
    border-bottom-right-radius: 2px;
}

.chat-input { 
    padding: 12px; 
    border-top: 1px solid #eee; 
    display: flex; 
    gap: 8px; 
}

.chat-input input { 
    flex: 1; 
    border: 1px solid #eee; 
    padding: 10px; 
    border-radius: 10px; 
    outline: none;
    font-size: 0.85em;
}

.chat-input button { 
    background: var(--pink-dark); 
    color: var(--white); 
    border: none; 
    padding: 0 15px; 
    border-radius: 10px; 
    cursor: pointer;
    font-weight: 600;
}

/* --- Popup Overlay & Box --- */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: none; /* Dikontrol JS */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#popup {
    background: var(--white);
    padding: 30px;
    border-radius: 25px;
    text-align: center;
    width: 280px;
    transform: scale(0.7);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active { display: flex; }
.overlay.active #popup { transform: scale(1); }

#popup h2 { color: var(--pink-dark); margin-top: 0; }
#popup button {
    background: var(--pink-dark);
    color: var(--white);
    border: none;
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
}

/* Responsif buat layar kecil */
@media (max-width: 400px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
    #chat-container { width: calc(100vw - 40px); right: 20px; }
}

/* Overlay untuk klik luar chat */
#chat-overlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.1); /* Tipis banget biar tetep estetik */
    display: none; /* Awalnya sembunyi */
    z-index: 999; 
}

/* Header Chat & Tombol Close */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--pink-dark);
    color: white;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ef037;
    border-radius: 50%;
    box-shadow: 0 0 5px #4ef037;
}

.close-chat-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-chat-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* Memastikan chat-container di atas overlay */
#chat-container {
    z-index: 1000;
}

.btn-notif {
    background: var(--pink-light);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-notif:hover {
    background: var(--pink-dark);
}