/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Animations ── */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ── Base ── */
body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1040 40%, #0d1b3e 100%);
  color: #e0e0e0;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Stars ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 40% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 15% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 50% 70%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 80% 75%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 95% 40%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 5% 90%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 45% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 75% 50%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 20% 50%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 35% 95%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 60% 5%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 8% 30%, rgba(255,255,255,0.5), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out;
}

.logo {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 0.75rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow:
    0 0 20px rgba(217, 165, 80, 0.4),
    0 0 60px rgba(217, 165, 80, 0.15);
  animation: glowPulse 3s ease-in-out infinite;
}

.header-svg {
  max-width: 640px;
  width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: drop-shadow(0 0 15px rgba(217, 165, 80, 0.3));
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ── Layout ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

/* ── Calendar section ── */
.calendar-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Grid card — glassmorphism */
.cal-grid-wrapper {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cal-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cal-month-label {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(217, 165, 80, 0.5);
  color: #fff;
}

.cal-today-btn {
  margin-left: 0.35rem;
  padding: 0 0.75rem;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.cal-today-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(217, 165, 80, 0.5);
}

/* Weekday headers */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.3rem;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.4rem;
}

/* Day cells */
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 8px;
  gap: 3px;
  transition: background 0.15s;
}

.cal-day-num {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1;
}

.cal-day--past .cal-day-num {
  color: rgba(255, 255, 255, 0.25);
}

.cal-day--today {
  background: rgba(217, 165, 80, 0.85);
  box-shadow: 0 0 12px rgba(217, 165, 80, 0.4);
}

.cal-day--today .cal-day-num {
  color: #fff;
  font-weight: 700;
}

/* Future event days — amber glow */
.cal-day--has-event:not(.cal-day--today):not(.cal-day--past) {
  background: rgba(217, 165, 80, 0.2);
  border: 1px solid rgba(217, 165, 80, 0.3);
  cursor: pointer;
}

.cal-day--has-event:not(.cal-day--today):not(.cal-day--past):hover {
  background: rgba(217, 165, 80, 0.35);
}

/* Past event days */
.cal-day--past.cal-day--has-event {
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.cal-day--past.cal-day--has-event:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cal-day--past .cal-dot {
  background: rgba(255, 255, 255, 0.2);
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d9a550;
  flex-shrink: 0;
}

.cal-day--today .cal-dot {
  background: #ffe4a8;
}

/* Events list card — glassmorphism */
.cal-events-wrapper {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.75rem;
  position: relative;
  max-height: 560px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Thin subtle scrollbar */
.cal-events-wrapper::-webkit-scrollbar { width: 4px; }
.cal-events-wrapper::-webkit-scrollbar-track { background: transparent; }
.cal-events-wrapper::-webkit-scrollbar-thumb { background: rgba(217, 165, 80, 0.3); border-radius: 2px; }

.cal-events-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
}

.cal-group-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.3);
  margin: 1.5rem 0 0.6rem;
}

/* Remove extra top margin from first group */
.cal-group-heading:first-child { margin-top: 0; }

/* Past / upcoming divider */
.cal-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #d9a550;
}

.cal-divider::before,
.cal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(217, 165, 80, 0.2);
}

/* Hidden when there are no past events */
.cal-divider--hidden {
  display: none;
}

/* Event cards */
.event-card {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.event-card:last-child { border-bottom: none; }

.event-badge {
  flex-shrink: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(217, 165, 80, 0.2);
  border: 1px solid rgba(217, 165, 80, 0.3);
  border-radius: 10px;
  padding: 0.45rem 0.25rem;
  color: #fff;
}

.event-badge-day {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: #ffe4a8;
}

.event-badge-month {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 228, 168, 0.7);
  line-height: 1.6;
}

.event-badge-weekday {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.event-info {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.event-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.event-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.event-icon { font-size: 0.75rem; }

.event-location-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 2px;
}

.event-location-link:hover {
  color: #d9a550;
  text-decoration-color: #d9a550;
}

.event-meta--organizers { color: rgba(255, 255, 255, 0.4); }

.event-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.4rem;
  line-height: 1.55;
}

.event-bring {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.4rem;
  line-height: 1.55;
}

.event-bring-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

/* Multi-day badge styles */
.event-badge-day-range {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  color: #ffe4a8;
}

.event-badge-range {
  font-size: 0.58rem;
  font-weight: 600;
  color: rgba(255, 228, 168, 0.6);
  line-height: 1.5;
  text-align: center;
}

.event-badge-range-arrow {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1;
}

.event-register-btn {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.35rem 1rem;
  background: rgba(217, 165, 80, 0.25);
  color: #ffe4a8;
  border: 1px solid rgba(217, 165, 80, 0.4);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.event-register-btn:hover {
  background: rgba(217, 165, 80, 0.4);
  border-color: rgba(217, 165, 80, 0.6);
}

.event-register-btn--disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: default;
  pointer-events: none;
}

/* State messages */
.cal-empty, .cal-loading {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.5rem 0;
}

.cal-error {
  font-size: 0.88rem;
  color: #f87171;
  padding: 0.5rem 0;
}

/* ── Action buttons (cloud style) ── */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.action-btn {
  flex: 1;
  display: inline-block;
  padding: 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1040;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 4px 15px rgba(255, 255, 255, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  animation: float 4s ease-in-out infinite;
}

.action-btn:nth-child(2) {
  animation-delay: -1s;
}

.action-btn:hover:not([disabled]) {
  background: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 25px rgba(217, 165, 80, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.2);
}

.action-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Header buttons ── */
.header-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.guidelines-btn {
  display: inline-block;
  padding: 0.45rem 1.25rem;
  border: 1.5px solid rgba(217, 165, 80, 0.5);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #d9a550;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.guidelines-btn:hover {
  background: rgba(217, 165, 80, 0.15);
  border-color: #d9a550;
  color: #ffe4a8;
  box-shadow: 0 0 15px rgba(217, 165, 80, 0.2);
}

/* ── Guidelines page ── */
.guidelines-page {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem 1.75rem 2.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.guidelines-body h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #fff;
}

.guidelines-body > p:first-of-type {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.guidelines-body h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: #fff;
}

.guidelines-body p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.6rem;
}

.guidelines-body ul, .guidelines-body ol {
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
}

.guidelines-body li {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.35rem;
}

.guidelines-body strong { color: #fff; }

.guidelines-body a { color: #d9a550; }
.guidelines-body a:hover { color: #ffe4a8; }

.guidelines-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.25rem 0;
}

/* ── Home intro ── */
.home-intro {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.home-intro p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.home-intro p:last-child {
  margin-bottom: 0;
}

.home-flag {
  font-size: 1.5rem;
  margin-bottom: 0.5rem !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header h1 { font-size: 1.1rem; }
  .header-svg { max-width: 480px; }
  .cal-day-num { font-size: 0.75rem; }
  .event-badge { width: 44px; }
  .event-badge-day { font-size: 1.1rem; }
  .event-title { font-size: 0.88rem; }
  .cal-events-wrapper { max-height: 420px; }
  .action-btn { font-size: 0.9rem; padding: 0.8rem 1.2rem; }
}
