/* ====== Base & Background ====== */
:root{
  --bg1:#fce4ec;      /* soft pink */
  --bg2:#fdebd3;      /* peach */
  --bg3:#e3f2fd;      /* sky blue */
  --bg4:#e8f5e9;      /* mint */
  --card:#ffffff;
  --muted:#f4f6f8;

  --text:#333;
  --muted-text:#556;
  --shadow:0 8px 24px rgba(0,0,0,.08);

  /* Pastel buttons */
  --green:#c9f7c5;   /* Done */
  --yellow:#ffe9a8;  /* Edit */
  --red:#ffb3b3;     /* Delete */
  --purple:#cbb9ff;  /* Add */
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3), var(--bg4));
  background-size: 100% 100%;
  overflow:hidden; /* no scrollbars */
}

/* ====== Header ====== */
.app-header{
  display:grid;
  grid-template-columns: 72px 1fr 72px; /* left / centered title / right spacer */
  align-items:center;
  padding:12px 16px;
}
.logo{
  height:111px;
  width:111px;
  object-fit:cover;
  border-radius:12px;
  box-shadow:var(--shadow);
}
.header-title{
  text-align:center;
  margin:0;
  font-weight:700;
  letter-spacing:.4px;
}

/* ====== Calendar Wrap ====== */
.calendar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 140px); /* full screen minus header */
  padding: 0 12px;
}

/* ====== Calendar Card ====== */
.calendar-card {
  width: min(95vw, 950px);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:16px;
}

/* Top nav */
.nav-row{
  display:grid;
  grid-template-columns: 48px 1fr 48px;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.month-title{
  margin:0;
  text-align:center;
  font-size: clamp(18px, 2.4vw, 24px);
}
.nav-btn{
  height:36px; width:36px;
  border:none; border-radius:10px;
  background: var(--muted);
  cursor:pointer;
  font-size:18px; color:#444;
  transition: transform .08s ease;
}
.nav-btn:active{ transform: scale(.95); }

/* Weekday row */
.weekdays{
  display:grid;
  grid-template-columns: repeat(7,1fr);
  gap:6px;
  margin:6px 0;
}
.weekdays > div{
  background:#eef3f7;
  color:#556;
  font-weight:600;
  text-align:center;
  padding:8px 0;
  border-radius:10px;
}

/* Days grid (fills remaining height) */
.days-grid{
  flex:1;
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr; /* equal row heights */
  gap:6px;
}
.day-cell{
  background:#fbfbfb;
  border-radius:12px;
  padding:6px;
  position:relative;
  text-align:left;
  box-shadow: inset 0 0 0 1px #edf0f4;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.day-cell:hover{
  transform: translateY(-1px);
  background:#f7f9fb;
  box-shadow: inset 0 0 0 1px #e3e8ef;
}
.day-num{
  font-weight:600;
  color:var(--muted-text);
}
.icon-badge{
  font-size:18px;
  align-self:center;
  margin-bottom:4px;
}
.today-ring{
  position:absolute;
  top:6px; left:8px;
  padding:2px 8px;
  border-radius:999px;
  border:2px solid #ffb74d;
}

/* ====== Modal (To-Do List) ====== */
.modal{
  position:fixed; inset:0;
  background: rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:1000;
}
.modal.show{ display:flex; }
.modal-content{
  width: clamp(480px, 55vw, 560px);
  background:#fff7fa;
  border-radius:20px;
  box-shadow: var(--shadow);
  padding:22px 20px 18px;
  position:relative;
}
.modal-title{
  margin:0 0 12px;
  text-align:center;
  font-size:22px;
}
.modal-close{
  position:absolute; right:12px; top:10px;
  width:32px; height:32px;
  border:none; border-radius:10px;
  background:#f0e9ef; color:#444; font-size:20px;
  cursor:pointer;
}

/* Task list */
.task-list{ display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.task-item{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; background:#ffffff; border-radius:12px; padding:10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.task-text{ flex:1; color:#333; }
.task-text.done{ text-decoration: line-through; color:#7a7a7a; }

/* Add row */
.task-add{
  display:flex; gap:8px; align-items:center; justify-content:center;
  margin-top:6px;
}
.task-input{
  flex:1;
  height:42px;
  border:1px solid #e5e8ee;
  border-radius:12px;
  padding:0 12px;
  font-size:16px;
  background:#fff;
}
.task-time{
  width:110px; height:42px;
  border:1px solid #e5e8ee; border-radius:12px;
  padding:0 10px; background:#fff;
  font-size:14px;
}

/* Buttons */
.btn{
  border:none; border-radius:10px; cursor:pointer;
  padding:10px 14px; font-weight:600; font-size:14px;
}
.add-btn{ background: var(--purple); color:#2b2350; }
.done-btn{ background: var(--green); color:#114d0d; }
.edit-btn{ background: var(--yellow); color:#5b4b00; }
.delete-btn{ background: var(--red); color:#5a0000; }

/* Subtle hover */
.btn:hover{ filter: brightness(.98); }
.btn:active{ transform: translateY(1px); }

/* Responsive tweak */
@media (max-width:720px){
  .logo{ height:56px; width:56px; }
  .calendar-card{ padding:10px; }
  .day-cell{ padding:4px; }
}

/* ====== Footer ====== */
.app-footer {
  position: fixed;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.9);
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.download-btn {
  background: var(--purple);
  color: #2b2350;
  padding: 8px 12px;
  font-size: 14px;
}

.copyright {
  color: #444;
  font-weight: 600;
}
