/* === GLOBAL STYLE === */
body {
  font-family: "Poppins", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #74ebd5, #acb6e5);
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  overflow-x: hidden;
}

/* === CONTAINER === */
.container {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === HEADER === */
header {
  text-align: center;
  margin-bottom: 10px;
}
header h1 {
  font-size: 1.7em;
  color: #2c3e50;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* === WEEK NAVIGATION === */
.week-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #555;
}
.week-nav button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}
.week-nav button:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* === GRID === */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
  flex: 1;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s ease;
}

/* === Animasi berpindah antar minggu === */
.schedule-grid.fade-out {
  opacity: 0;
  transform: translateY(10px);
}
.schedule-grid.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* === DAY COLUMN === */
.day-column {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 8px;
  min-height: 280px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  text-align: left; /* daftar dan teks kembali rata kiri */
}

/* Hari aktif (hari ini) — penanda jelas */
.day-column.today {
  background: linear-gradient(180deg, #fff4d6, #ffe082);
  border: 2px solid #f39c12;
  box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
  transform: scale(1.02);
}

/* === HEADER HARI === */
.day-header {
  font-weight: bold;
  color: #34495e;
  font-size: 1em;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 3px;
}

/* === TASK LIST === */
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  text-align: left; /* pastikan daftar aktivitas rata kiri */
}

/* === Warna pelangi lembut === */
.task-item:nth-child(7n + 1) {
  background: linear-gradient(90deg, rgba(255, 99, 132, 0.15), rgba(255, 99, 132, 0.25));
}
.task-item:nth-child(7n + 2) {
  background: linear-gradient(90deg, rgba(255, 159, 64, 0.15), rgba(255, 159, 64, 0.25));
}
.task-item:nth-child(7n + 3) {
  background: linear-gradient(90deg, rgba(255, 205, 86, 0.15), rgba(255, 205, 86, 0.25));
}
.task-item:nth-child(7n + 4) {
  background: linear-gradient(90deg, rgba(75, 192, 192, 0.15), rgba(75, 192, 192, 0.25));
}
.task-item:nth-child(7n + 5) {
  background: linear-gradient(90deg, rgba(54, 162, 235, 0.15), rgba(54, 162, 235, 0.25));
}
.task-item:nth-child(7n + 6) {
  background: linear-gradient(90deg, rgba(153, 102, 255, 0.15), rgba(153, 102, 255, 0.25));
}
.task-item:nth-child(7n + 7) {
  background: linear-gradient(90deg, rgba(255, 99, 255, 0.15), rgba(255, 99, 255, 0.25));
}

.task-item {
  margin-bottom: 5px;
  padding: 6px 8px;
  border-left: 3px solid #3498db;
  border-radius: 6px;
  font-size: 0.9em;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.task-item:hover {
  transform: scale(1.02);
  background: rgba(230, 245, 255, 0.95);
}
.task-item.completed {
  text-decoration: line-through;
  opacity: 0.75;
  border-left-color: #27ae60;
  background: rgba(213, 244, 230, 0.9);
}

/* === DELETE BUTTON === */
.delete-btn {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 10px;
  display: none;
}
.task-item:hover .delete-btn {
  display: block;
}

/* === ADD TASK SECTION === */
.add-task-section {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.add-task-section input,
.add-task-section select,
.add-task-section button {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}
.add-task-section button {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.add-task-section button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* === RESPONSIVE === */

/* Android — scroll kiri–kanan antar minggu */
@media (max-width: 768px) {
  .schedule-grid {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }
  .day-column {
    flex: 0 0 85%;
    scroll-snap-align: start;
    min-width: 250px;
  }
}

/* Layar kecil */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.4em;
  }
  .day-column {
    min-height: 230px;
    font-size: 0.85em;
  }
  .task-item {
    font-size: 0.8em;
    padding: 5px;
  }
}
