@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Source+Serif+4:wght@400;600;700&display=swap");

:root {
  --bg: #0f1218;
  --panel: #171c27;
  --card: #1b2230;
  --text: #f2f5ff;
  --muted: #b3bed8;
  --accent: #ffd166;
  --accent-2: #6be7c1;
  --line: rgba(255,255,255,0.08);
  --shadow: rgba(0, 0, 0, 0.28);
  --input-bg: #121620;
  --header-bg: rgba(10, 12, 18, 0.88);
  --btn-bg: #1b2330;
  --btn-primary-bg: #252f3f;
}

[data-season="halloween"] {
  --accent: #ff8f3d;
  --accent-2: #ff5f5f;
}

[data-season="christmas"] {
  --accent: #d94b4b;
  --accent-2: #2fbf71;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #1a1d26;
  --muted: #5a6578;
  --accent: #e5a800;
  --accent-2: #0d9668;
  --line: rgba(0,0,0,0.1);
  --shadow: rgba(0, 0, 0, 0.08);
  --input-bg: #f0f2f5;
  --header-bg: rgba(255, 255, 255, 0.92);
  --btn-bg: #e8ecf2;
  --btn-primary-bg: #dde3eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(255, 209, 102, 0.18), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(107, 231, 193, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.2s ease;
}

[data-season="halloween"] body {
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(255, 143, 61, 0.22), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(255, 95, 95, 0.18), transparent 55%),
    var(--bg);
}

[data-season="christmas"] body {
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(217, 75, 75, 0.2), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(47, 191, 113, 0.18), transparent 55%),
    var(--bg);
}

[data-theme="light"] body {
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(255, 209, 102, 0.15), transparent 60%),
    radial-gradient(900px 700px at 90% 0%, rgba(107, 231, 193, 0.1), transparent 55%),
    var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: var(--btn-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--btn-primary-bg);
}
.season-toggle {
  background: var(--btn-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: background-color 0.2s ease;
}
.season-toggle:hover {
  background: var(--btn-primary-bg);
}

.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(140deg, #ffd166, #ff9f43 65%, #ff6b5a);
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 10px 25px rgba(255, 209, 102, 0.25);
}
.title { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.2px; }
.subtitle { color: var(--muted); font-size: 0.82rem; }
.clock { color: var(--muted); font-size: 0.9rem; }

.page { padding: 22px 16px 40px; max-width: 1100px; margin: 0 auto; }

.hero {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.hero h1 { font-size: 1.6rem; font-family: "Source Serif 4", serif; }
.hero p { color: var(--muted); font-weight: 400; }
.hero-actions { margin-top: 12px; }
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff9f43);
  color: #241800;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 22px rgba(255, 209, 102, 0.3);
}
.primary-cta:hover { opacity: 0.9; }
.hero-card {
  background: linear-gradient(160deg, rgba(37, 47, 63, 0.9), rgba(23, 28, 39, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 30px var(--shadow);
}
.hero-title { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; }
.hero-next { font-size: 1.4rem; font-weight: 800; }
.hero-time { font-size: 2.1rem; color: var(--accent-2); font-weight: 800; }
.hero-meta { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

[data-theme="light"] .hero-card {
  background: #ffffff;
  border: 1px solid var(--line);
}

.layout {
  display: grid;
  gap: 18px;
}

.main-content {
  display: grid;
  gap: 18px;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.section { margin-top: 22px; }
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.section.panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.window-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.toggle-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.toggle-btn.active {
  background: #263246;
  border-color: rgba(255, 209, 102, 0.4);
  color: var(--accent);
}
.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0 6px;
  align-items: end;
}
.tool label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.tool select,
.tool input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
}
.search-tool input { font-size: 0.95rem; }
.filter-tool {
  position: relative;
}
.filter-toggle {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.filter-toggle:hover { background: var(--btn-primary-bg); }
.filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  display: none;
  z-index: 20;
  box-shadow: 0 14px 24px var(--shadow);
}
.filter-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.filter-menu button:hover { background: var(--btn-primary-bg); }
.filter-menu button.active { color: var(--accent); }

.custom {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.custom-toggle {
  display: inline-flex;
  gap: 6px;
  background: var(--btn-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-top: 6px;
}
.toggle-pill {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}
.toggle-pill.active {
  background: var(--btn-primary-bg);
  color: var(--accent);
}
.custom-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 8px;
}
.date-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.custom-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
}
.date-btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.custom-form button {
  background: var(--accent);
  color: #241800;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.custom-output { margin-top: 10px; color: var(--muted); }
.custom-note { margin-top: 8px; color: var(--muted); font-size: 0.85rem; }

.custom-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.list {
  display: grid;
  gap: 10px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.list-title { font-weight: 600; }
.list-meta { color: var(--muted); font-size: 0.85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 30px var(--shadow);
  display: grid;
  gap: 8px;
}
.card-title { font-weight: 700; }
.card-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 0.7rem;
}
.card-link {
  color: inherit;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }
.card-meta { color: var(--muted); font-size: 0.8rem; }
.card-time { color: var(--accent-2); font-size: 1.25rem; font-weight: 800; }
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.card-menu {
  position: relative;
  margin-left: auto;
}
.menu-toggle {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.menu-toggle:hover { background: var(--btn-primary-bg); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  display: none;
  z-index: 20;
  box-shadow: 0 14px 24px var(--shadow);
}
.menu-panel.is-open { display: block; }
.menu-panel button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.menu-panel button:hover { background: var(--btn-primary-bg); }
.action-btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.action-btn:hover {
  background: var(--btn-primary-bg);
}
.action-btn.primary {
  background: var(--btn-primary-bg);
}
.action-btn.primary:hover {
  opacity: 0.85;
}
.action-btn.fav-btn {
  font-size: 1rem;
  padding: 6px 10px;
}
.action-btn.fav-btn.active {
  color: var(--accent);
}
.action-btn.warn {
  background: #2a1f24;
  border-color: rgba(255, 107, 90, 0.45);
  color: #ffb0a8;
}

.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
.faq-q { font-weight: 700; margin-bottom: 6px; }
.faq-a { color: var(--muted); font-size: 0.9rem; }

.ad-slot { margin: 20px 0 0; }
.ad-box {
  height: 110px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

.milestone-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #ff9f43);
  color: #241800;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.favorites-empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.site-footer { padding: 18px 16px 40px; text-align: center; color: var(--muted); }
.tiny { font-size: 0.8rem; }

.event-page .page { max-width: 900px; }
.event-hero {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 30px var(--shadow);
}
.event-hero h1 { font-size: 1.6rem; font-family: "Source Serif 4", serif; }
.event-countdown { font-size: 1.9rem; color: var(--accent-2); font-weight: 700; }
.event-meta { color: var(--muted); }
.event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.event-actions a {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.event-actions a:hover { background: var(--btn-primary-bg); }

/* Mobile touch-friendly improvements */
@media (max-width: 720px) {
  .custom-form { grid-template-columns: 1fr; }
  .date-field { grid-template-columns: 1fr auto; }

  .action-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
  }

  .theme-toggle {
    min-height: 44px;
    min-width: 44px;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-time {
    font-size: 2rem;
  }


  .card {
    padding: 16px;
  }

  .card-actions {
    gap: 10px;
  }

  .tool select,
  .tool input {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .custom-form input,
  .custom-form button,
  .date-btn {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr 140px; align-items: end; }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .side-panel { position: sticky; top: 96px; align-self: start; }
}

@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
