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

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  color: #3e2e1e;
  background: #d8c39a;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.05) 0, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.05) 0, transparent 45%);
  min-height: 100vh;
}

/* ---------- Navbar ---------- */
.navbar {
  background: #3e2e1e;
  color: #fdf6e3;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .brand {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.5px;
}
.navbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar a.nav-link {
  color: #fdf6e3;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 20px;
  transition: background 0.15s ease;
}
.navbar a.nav-link:hover,
.navbar a.nav-link.active {
  background: rgba(255,255,255,0.15);
}
.navbar .who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}
.navbar .avatar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fdf6e3;
}
.navbar button.logout-btn {
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  background: #a5473a;
  color: #fdf6e3;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.navbar button.logout-btn:hover { background: #8f3a2f; }

/* ---------- Layout ---------- */
main.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1.page-title {
  font-family: 'Kalam', cursive;
  font-size: 32px;
  margin-bottom: 4px;
}
p.page-sub {
  opacity: 0.75;
  margin-top: 0;
}

/* ---------- Corkboard ---------- */
.corkboard {
  position: relative;
  min-height: 560px;
  background-color: #b8763f;
  background-image:
    radial-gradient(rgba(0,0,0,0.12) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 6px 6px, 9px 9px;
  background-position: 0 0, 3px 3px;
  border: 14px solid #6b4226;
  border-radius: 10px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4), 0 6px 16px rgba(0,0,0,0.3);
  overflow: hidden;
}

.add-note-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.add-note-bar textarea {
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  padding: 10px;
  border-radius: 6px;
  border: 2px solid #6b4226;
  resize: vertical;
  min-height: 44px;
  flex: 1;
  min-width: 220px;
}
.color-swatches {
  display: flex;
  gap: 6px;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.3);
  cursor: pointer;
}
.color-swatch.selected {
  outline: 3px solid #3e2e1e;
  outline-offset: 2px;
}
button.btn {
  font-family: 'Patrick Hand', cursive;
  font-size: 19px;
  background: #4a7c59;
  color: #fdf6e3;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}
button.btn:hover { background: #3d6749; }
button.btn.secondary { background: #7a6a53; }
button.btn.secondary:hover { background: #665945; }
button.btn.danger { background: #a5473a; }
button.btn.danger:hover { background: #8f3a2f; }

.postit {
  position: absolute;
  width: 190px;
  min-height: 150px;
  padding: 14px 12px 30px;
  box-shadow: 3px 6px 10px rgba(0,0,0,0.35);
  cursor: grab;
  font-size: 19px;
  line-height: 1.25;
  word-wrap: break-word;
  transition: box-shadow 0.15s ease;
}
.postit:active { cursor: grabbing; box-shadow: 5px 10px 16px rgba(0,0,0,0.45); }
.postit .pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #a5473a);
  border-radius: 50%;
  box-shadow: 0 2px 3px rgba(0,0,0,0.5);
}
.postit .meta {
  position: absolute;
  bottom: 6px;
  left: 12px;
  right: 12px;
  font-size: 13px;
  opacity: 0.65;
  display: flex;
  justify-content: space-between;
}
.postit .remove-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.5;
}
.postit .remove-btn:hover { opacity: 1; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fdf6e3;
  border: 3px solid #6b4226;
  border-radius: 12px;
  padding: 36px 40px;
  width: 320px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-align: center;
}
.login-card h1 {
  font-family: 'Kalam', cursive;
  margin-top: 0;
}
.login-card input {
  width: 100%;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  border: 2px solid #6b4226;
}
.login-card button {
  width: 100%;
  margin-top: 10px;
}
.error-msg {
  color: #a5473a;
  font-size: 15px;
  min-height: 20px;
}

/* ---------- Calendar ---------- */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-controls .month-label {
  font-family: 'Kalam', cursive;
  font-size: 26px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-grid .dow {
  text-align: center;
  font-weight: bold;
  opacity: 0.7;
  padding-bottom: 4px;
}
.day-cell {
  background: #fdf6e3;
  border: 2px solid #6b4226;
  border-radius: 8px;
  min-height: 100px;
  padding: 6px;
  position: relative;
  cursor: pointer;
}
.day-cell.other-month { opacity: 0.4; }
.day-cell.today { border-color: #4a7c59; border-width: 3px; }
.day-cell .day-num { font-weight: bold; font-size: 15px; }
.day-cell:hover { background: #f5ecd0; }
.event-chip {
  font-size: 13px;
  border-radius: 5px;
  padding: 2px 5px;
  margin-top: 3px;
  color: #fdf6e3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: #fdf6e3;
  border: 3px solid #6b4226;
  border-radius: 12px;
  padding: 26px 30px;
  width: 380px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h2 { font-family: 'Kalam', cursive; margin-top: 0; }
.modal label { display: block; margin: 12px 0 4px; font-size: 16px; }
.modal input[type=text], .modal input[type=datetime-local], .modal textarea {
  width: 100%;
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  padding: 8px;
  border-radius: 6px;
  border: 2px solid #6b4226;
}
.assignee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.assignee-pill {
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  color: #fdf6e3;
  font-size: 15px;
  opacity: 0.55;
}
.assignee-pill.selected { opacity: 1; border-color: #3e2e1e; }
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
.hidden { display: none !important; }
