/* whispers.css · 私语日历样式 (v0.2) */

:root {
  --bg1: #1a0025;
  --bg2: #0b0012;
  --ink: #f6eaff;
  --muted: #cdb6ff;
  --accent: #a974ff;
  --accent2: #663399;
  --glass: rgba(255, 255, 255, 0.08);
  --glass2: rgba(255, 255, 255, 0.05);
  --border: rgba(169, 116, 255, 0.55);
  --shadow: rgba(170, 100, 255, 0.22);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: radial-gradient(ellipse at center, var(--bg1) 0%, var(--bg2) 100%);
  color: var(--ink);
  min-height: 100vh;
}

/* Page container (works even if your HTML doesn't have a wrapper) */
.container,
.whispers-container,
main {
  max-width: 980px;
  margin: 90px auto 80px;
  padding: 0 20px;
}

h1, h2, h3 {
  color: var(--ink);
  letter-spacing: 0.3px;
}

/* --- Calendar header (month + nav buttons) --- */
.calendar-header,
#calendarHeader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 10px auto 18px;
}

.calendar-header button,
#calendarHeader button,
#prevMonth,
#nextMonth {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(17, 17, 34, 0.25);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 120ms ease, background 180ms ease, border-color 180ms ease;
}

.calendar-header button:hover,
#calendarHeader button:hover,
#prevMonth:hover,
#nextMonth:hover {
  background: rgba(169, 116, 255, 0.18);
  border-color: rgba(255,255,255,0.45);
  transform: translateY(-1px);
}

.calendar-header button:active,
#calendarHeader button:active,
#prevMonth:active,
#nextMonth:active {
  transform: translateY(0px) scale(0.98);
}

#monthYear,
#calendar-month,
#month-label {
  font-size: 1.15em;
  color: var(--muted);
  letter-spacing: 0.6px;
}

/* --- Calendar grid (new structure) --- */
#calendar-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(40px, 1fr));
  gap: 10px;
  justify-items: center;
  align-items: center;
  padding: 18px;
  margin: 0 auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(169, 116, 255, 0.20);
  box-shadow: 0 0 22px rgba(170, 100, 255, 0.10);
}

/* Weekday labels (if your HTML uses them) */
.day-name,
.weekday,
.calendar-weekday {
  color: rgba(246, 234, 255, 0.85);
  font-size: 0.86em;
  letter-spacing: 0.5px;
  user-select: none;
  opacity: 0.92;
}

/* Date cell (supports multiple class names + data-day) */
.calendar-date,
.date,
.date-cell,
.day,
[data-day] {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--glass2);
  border: 1px solid rgba(169, 116, 255, 0.35);
  color: rgba(227, 209, 255, 0.95);
  transition: transform 160ms ease, background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  user-select: none;
}

.calendar-date:hover,
.date:hover,
.date-cell:hover,
.day:hover,
[data-day]:hover {
  background: rgba(169, 116, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(180, 140, 255, 0.35);
}

/* Optional: selected state if you add .is-selected in JS later */
.is-selected {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.10), 0 0 18px rgba(169, 116, 255, 0.22) !important;
}

/* --- Legacy layout support (old #calendar flex wrap) --- */
#calendar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2em;
  gap: 10px;
}

/* --- Whisper display box (support multiple IDs) --- */
#whisper-box,
#whisperDisplay,
[data-whisper-box] {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 18px 18px;
  border-radius: 16px;
  background-color: var(--glass);
  border: 1px solid var(--border);
  box-shadow: 0 0 18px var(--shadow);
  color: rgba(240, 223, 255, 0.98);
  font-size: 1.05em;
  line-height: 1.75;
}

/* Animation used by whispers.js (adds/removes .fade-in) */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.45s ease forwards;
}

/* Keep your old .show hook working if it exists */
#whisper-box.show,
#whisperDisplay.show {
  animation: fadeIn 0.45s ease forwards;
}

/* Small screens */
@media (max-width: 520px) {
  .container,
  .whispers-container,
  main {
    margin-top: 70px;
  }

  #calendar-grid,
  .calendar-grid {
    padding: 14px;
    gap: 8px;
  }

  .calendar-date,
  .date,
  .date-cell,
  .day,
  [data-day] {
    width: 40px;
    height: 40px;
  }

  #whisper-box,
  #whisperDisplay,
  [data-whisper-box] {
    font-size: 1.0em;
    padding: 16px;
  }
}