/* === GLOBAL STYLE === */
body {
  font-family: "Poppins", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #75928d, #999caa);
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  overflow-x: hidden;
}

/* === CONTAINER === */
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* === HEADER === */
.top-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
}

/* BARIS 1: Judul + user + logout */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Judul */
.header-row h1 {
  font-size: 1.7em;
  color: #2c3e50;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  margin: 0;
}

/* USER + LOGOUT */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Username badge */
.user-label {
  font-weight: bold;
  font-size: 14px;
  background: rgba(128, 211, 153, 0.647);
  padding: 6px 12px;
  border-radius: 6px;
  color: #2c3e50;
}

/* Tombol Logout */
.logout-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: #e74c3c;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  display: inline-block;
}

.logout-btn:hover {
  background: #c0392b;
}

/* === WEEK NAVIGATION === */
.week-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 1.0em;
  color: #242323;
}

/* Tombol nav */
.week-nav button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 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;
  transition: all 0.5s ease;
}

/* Animasi 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;
  height: calc(100vh - 240px); /* FIX tinggi penuh tanpa menutupi add task */
  display: flex;
  flex-direction: column;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* Hari aktif */
.day-column.today {
  background: linear-gradient(180deg, #fff6df, #ffedc2);
  border: 1px solid #f2d48a;
  box-shadow: 0 0 10px rgba(168, 201, 235, 0.4);
  transform: scale(1.01);
}

/* 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;
}

/* === Warna pelangi lembut === */
.task-item:nth-child(7n + 1) { background: linear-gradient(90deg, rgba(255,99,132,.15), rgba(255,99,132,.25)); }
.task-item:nth-child(7n + 2) { background: linear-gradient(90deg, rgba(255,159,64,.15), rgba(255,159,64,.25)); }
.task-item:nth-child(7n + 3) { background: linear-gradient(90deg, rgba(255,205,86,.15), rgba(255,205,86,.25)); }
.task-item:nth-child(7n + 4) { background: linear-gradient(90deg, rgba(75,192,192,.15), rgba(75,192,192,.25)); }
.task-item:nth-child(7n + 5) { background: linear-gradient(90deg, rgba(54,162,235,.15), rgba(54,162,235,.25)); }
.task-item:nth-child(7n + 6) { background: linear-gradient(90deg, rgba(153,102,255,.15), rgba(153,102,255,.25)); }
.task-item:nth-child(7n + 7) { background: linear-gradient(90deg, rgba(255,99,255,.15), rgba(255,99,255,.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: 8px 0;
  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: 0.2s;
}

.add-task-section button:hover {
  transform: scale(1.05);
}

/* === LOGIN PAGE === */
/* === LOGIN PAGE === */
/* === LOGIN PAGE === */
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;   /* pusat horizontal */
  align-items: center;       /* pusat vertikal */

  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.25);
  z-index: 999;
}

.login-card {
  width: 320px;
  padding: 25px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: fadeIn 0.3s ease;
}

/* Hilangkan margin default body agar tidak mempengaruhi posisi */
body {
  margin: 0;
  padding: 0;
}



.login-card h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.6em;
}

.login-sub {
  margin: 5px 0 15px 0;
  color: #555;
  font-size: 0.9em;
}

.login-input {
  width: 100%;
  padding: 12px;
  margin: 6px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.login-input:focus {
  border-color: #3498db;
}

.login-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border: none;
  color: white;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.login-btn:hover {
  transform: scale(1.03);
}

.login-error {
  margin-top: 10px;
  color: #e74c3c;
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.top-header .header-row {
    display: flex;
    justify-content: center;   /* pusatkan konten secara horizontal */
    align-items: center;
    position: relative;
}

/* Agar user-area tetap berada di kanan */
.top-header .user-area {
    position: absolute;
    right: 0;
}

.instructions {
    text-align: center;
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
  .schedule-grid {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scroll-snap-type: x mandatory;
  }

  .day-column {
    flex: 0 0 85%;
    min-width: 250px;
  }

  .header-row {
    flex-direction: column;
    gap: 6px;
  }
}

