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

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #fdfbfb, #ebedee);
  min-height: 100vh;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #1e293b;
  background-image: linear-gradient(#dbeafe 1px, transparent 1px),
    linear-gradient(90deg, #dbeafe 1px, transparent 1px);
  background-size: 24px 24px;
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
  font-family: "Patrick Hand", cursive;
  font-size: 34px;
  margin-bottom: 25px;
  color: #2563eb;
  text-shadow: 2px 2px #bfdbfe;
}

/* Container */
.container {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 6px 6px 0 #2563eb, 0 8px 20px rgba(0,0,0,0.15);
  width: 480px;
  max-width: 95vw;
  animation: pageOpen 0.6s ease;
}

@keyframes pageOpen {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: rotateY(0); opacity: 1; }
}

h1 {
  font-family: "Patrick Hand", cursive;
  font-size: 26px;
  margin: 20px 0;
  text-align: center;
  color: #111827;
}

/* Input */
.input-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.input-area input {
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 16px;
  transition: 0.3s;
}
.input-area input:focus {
  background: #e0f2fe;
  box-shadow: 0 0 8px #60a5fa;
  transform: scale(1.02);
  outline: none;
}

/* Button */
#add-btn, .edit-btn, .delete-btn {
  position: relative;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  transition: 0.2s;
  box-shadow: 3px 3px 0 #1e40af;
}
#add-btn:hover, .edit-btn:hover, .delete-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 5px 5px 0 #1e40af;
}

/* Todo item */
.todo-item {
  background: #fef9c3;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 4px 4px 0 #facc15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: bounceIn 0.5s ease;
}
@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

/* Table */
table {
  width: 720px;
  max-width: 95vw;
  margin-top: 30px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 6px 6px 0 #2563eb, 0 8px 20px rgba(0,0,0,0.15);
}
thead {
  background: #2563eb;
  color: white;
  font-family: "Patrick Hand", cursive;
  font-size: 18px;
}
th, td {
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
}
tbody tr:hover {
  background: #f0f9ff;
}

/* Animasi hapus */
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

/* Chat Karakter */
.bottom-chat {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 80px;
  z-index: 9999;
}
.mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 120px;
}
.mascot img {
  width: 90px;
  margin-bottom: 8px;
}
.bubble {
  background: #fff;
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 12px;
  font-size: 12px;
  text-align: center;
  word-wrap: break-word;
  opacity: 0;
  animation: talk 12s infinite;
}
/* Bubble warna */
.doraemon .bubble { background: #e0f7fa; border: 1px solid #4dd0e1; }
.spongebob .bubble { background: #fff9c4; border: 1px solid #fdd835; }

/* Animasi bubble */
@keyframes talk {
  0%, 100% { opacity: 0; transform: translateY(10px); }
  10%, 40% { opacity: 1; transform: translateY(0); }
  60%, 90% { opacity: 0; transform: translateY(-10px); }
}
.doraemon .bubble:nth-child(2) { animation-delay: 0s; }
.doraemon .bubble:nth-child(3) { animation-delay: 4s; }
.doraemon .bubble:nth-child(4) { animation-delay: 8s; }
.spongebob .bubble:nth-child(2) { animation-delay: 2s; }
.spongebob .bubble:nth-child(3) { animation-delay: 6s; }
.spongebob .bubble:nth-child(4) { animation-delay: 10s; }
