/* ═══════════════════════════════════════════════════════════
   Nanakshahi Calendar Website — App-Matched Design
   Colors from Flutter app: _kHeaderBg = #1A2A5E
   ═══════════════════════════════════════════════════════════ */

:root {
  --header-bg: #1A2A5E;
  --body-bg: #121212;
  --card-bg: #1E293B;
  --cell-bg: #1E293B;
  --cell-border: rgba(255,255,255,0.08);
  --text: #f8fafc;
  --text-muted: #9E9E9E;
  --text-dim: rgba(255,255,255,0.6);
  --gold: #F59E0B;
  --red: #EF4444;
  --blue: #3B82F6;
  --border: #334155;
  --primary: #c0392b;
  --primary-dark: #922b21;

  /* Event type colors — same as Flutter _kEventColors */
  --ev-gurp: #B71C1C;
  --ev-itih: #1A237E;
  --ev-gran: #1B5E20;
  --ev-khas: #E65100;
  --ev-sang: #6A1B9A;
  --ev-row-alt: #0F172A;
}

.light-mode {
  --body-bg: #f5f5f5;
  --card-bg: #ffffff;
  --cell-bg: #ffffff;
  --cell-border: rgba(0,0,0,0.12);
  --text: #212121;
  --text-muted: #9E9E9E;
  --text-dim: rgba(0,0,0,0.45);
  --border: #e2e8f0;
  --ev-row-alt: #F3F4FF;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  margin: 0;
  padding: 0;
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* ── Header — matches app AppBar ─────────────────────────── */
.main-header {
  background: var(--header-bg);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.main-header h1 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.today-btn {
  color: white;
  text-decoration: none;
  font-size: 0.85em;
  padding: 6px 14px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  transition: background 0.2s;
}
.today-btn:hover { background: rgba(255,255,255,0.3); }
.theme-btn, .lang-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s;
}
.theme-btn:hover, .lang-btn:hover { background: rgba(255,255,255,0.3); }
.back-btn {
  color: white;
  text-decoration: none;
  font-size: 0.9em;
}

/* ── Search ──────────────────────────────────────────────── */
.search-container {
  margin: 16px auto;
  max-width: 700px;
  padding: 0 16px;
}
#searchInput {
  width: 100%;
  padding: 12px 20px;
  font-size: 1em;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
}
#searchInput:focus { border-color: var(--gold); }

/* ── Month Navigation Bar — matches app's Container(color: _kHeaderBg) ── */
.month-nav {
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  max-width: 900px;
  margin: 0 auto;
}
.nav-arrow {
  background: none;
  border: none;
  color: white;
  font-size: 2em;
  cursor: pointer;
  padding: 4px 16px;
  line-height: 1;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.nav-arrow:hover { opacity: 1; }
.month-nav-center { text-align: center; flex-grow: 1; }
.month-nav-title {
  color: white;
  font-size: 1.3em;
  font-weight: bold;
}
.month-nav-sub {
  color: #CFD8DC;
  font-size: 0.85em;
  margin-top: 2px;
}

/* ── Weekday Header Bar — matches app's Row ────────────────── */
.weekday-bar {
  background: var(--header-bg);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 4px 10px;
  max-width: 900px;
  margin: 0 auto;
}
.wd {
  text-align: center;
  font-weight: bold;
  font-size: 0.8em;
  color: #CFD8DC;
}

/* ── Calendar content area ─────────────────────────────────── */
.calendar-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}
.jump-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.jump-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85em;
  transition: all 0.2s;
}
.jump-links a:hover {
  background: var(--header-bg);
  color: white;
  border-color: var(--header-bg);
}

/* ── Month section ───────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 10px 40px; }

.month-section {
  margin: 30px auto;
  max-width: 900px;
}

.month-header h2 {
  margin: 0;
  color: var(--gold);
  text-align: center;
  padding: 20px 0 15px;
}

/* ═══════════════════════════════════════════════════════════
   CALENDAR GRID — Matches Flutter app exactly
   ═══════════════════════════════════════════════════════════ */

.real-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 4px 4px 8px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ── Weekday headers (ਐਤ ਸੋਮ ਮੰਗ...) ──────────────────── */
.cal-header {
  text-align: center;
  font-weight: bold;
  font-size: 0.8em;
  padding: 10px 0;
  color: var(--text-dim);
}

.cal-empty { background: transparent; }

/* ── Each day cell ────────────────────────────────────────── */
.cal-day {
  background: var(--cell-bg);
  border: 1px solid var(--cell-border);
  border-radius: 8px;
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  cursor: default;
  transition: transform 0.15s;
  aspect-ratio: 1 / 1;
}
.cal-day:hover { transform: translateY(-1px); }

/* Gregorian day number — big, like app */
.cal-day .greg-day {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text);
  line-height: 1;
}

/* Nanakshahi date — small below, like app "ਪੋਹ ੧੯" */
.cal-day .nanak-day {
  font-size: 0.6em;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  max-width: 100%;
  text-align: center;
}

/* ── Colored event cells — matches app evColor.withOpacity ── */
.cal-day.has-gurp {
  background: rgba(183, 28, 28, 0.15);
  border-color: rgba(183, 28, 28, 0.3);
}
.cal-day.has-gurp .greg-day { color: var(--ev-gurp); font-weight: bold; }

.cal-day.has-itih {
  background: rgba(26, 35, 126, 0.15);
  border-color: rgba(26, 35, 126, 0.3);
}
.cal-day.has-itih .greg-day { color: var(--ev-itih); font-weight: bold; }
.light-mode .cal-day.has-itih .greg-day { color: #1A237E; }

.cal-day.has-sang {
  background: rgba(106, 27, 154, 0.15);
  border-color: rgba(106, 27, 154, 0.3);
}
.cal-day.has-sang .greg-day { color: var(--ev-sang); font-weight: bold; }

.cal-day.has-khas {
  background: rgba(230, 81, 0, 0.15);
  border-color: rgba(230, 81, 0, 0.3);
}
.cal-day.has-khas .greg-day { color: var(--ev-khas); font-weight: bold; }

.cal-day.has-gran {
  background: rgba(27, 94, 32, 0.15);
  border-color: rgba(27, 94, 32, 0.3);
}
.cal-day.has-gran .greg-day { color: var(--ev-gran); font-weight: bold; }

/* ── Colored dot under date — exactly like app ───────────── */
.dots-row {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  min-height: 6px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-gurp { background-color: var(--ev-gurp); }
.dot-itih { background-color: var(--ev-itih); }
.dot-sang { background-color: var(--ev-sang); }
.dot-khas { background-color: var(--ev-khas); }
.dot-gran { background-color: var(--ev-gran); }

.light-mode .dot-itih { background-color: #1A237E; }

/* ═══════════════════════════════════════════════════════════
   EVENT LIST BELOW CALENDAR — Matches Flutter app layout
   Color bar | Date badge | Event name + type label | ➤
   ═══════════════════════════════════════════════════════════ */

.month-events-list {
  margin-top: 12px;
}
.month-events-list h3 {
  padding: 14px 16px 10px;
  margin: 0;
  font-size: 0.95em;
  font-weight: bold;
  color: var(--gold);
}

.event-list-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 12px 16px;
  transition: background 0.15s;
  color: var(--text);
  border-bottom: 1px solid var(--cell-border);
}
.event-list-item:nth-child(odd) {
  background: var(--ev-row-alt);
}
.event-list-item:hover {
  background: rgba(245, 158, 11, 0.08);
}

/* Color bar on left — like app Container(width:4, height:48, color:color) */
.eli-bar {
  width: 4px;
  height: 48px;
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}
.eli-bar.bar-gurp { background: var(--ev-gurp); }
.eli-bar.bar-itih { background: var(--ev-itih); }
.eli-bar.bar-sang { background: var(--ev-sang); }
.eli-bar.bar-khas { background: var(--ev-khas); }
.eli-bar.bar-gran { background: var(--ev-gran); }

/* Date badge — like app's Container with color.withOpacity(0.1) */
.eli-date {
  width: 52px;
  min-height: 52px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  padding: 4px;
}
.eli-date.badge-gurp { background: rgba(183, 28, 28, 0.12); }
.eli-date.badge-itih { background: rgba(26, 35, 126, 0.12); }
.eli-date.badge-sang { background: rgba(106, 27, 154, 0.12); }
.eli-date.badge-khas { background: rgba(230, 81, 0, 0.12); }
.eli-date.badge-gran { background: rgba(27, 94, 32, 0.12); }

.light-mode .eli-date.badge-gurp { background: rgba(183, 28, 28, 0.08); }
.light-mode .eli-date.badge-itih { background: rgba(26, 35, 126, 0.08); }
.light-mode .eli-date.badge-sang { background: rgba(106, 27, 154, 0.08); }
.light-mode .eli-date.badge-khas { background: rgba(230, 81, 0, 0.08); }

.eli-g-day {
  font-size: 1.4em;
  font-weight: bold;
}
.eli-date.badge-gurp .eli-g-day { color: var(--ev-gurp); }
.eli-date.badge-itih .eli-g-day { color: var(--ev-itih); }
.eli-date.badge-sang .eli-g-day { color: var(--ev-sang); }
.eli-date.badge-khas .eli-g-day { color: var(--ev-khas); }
.eli-date.badge-gran .eli-g-day { color: var(--ev-gran); }

.light-mode .eli-date.badge-itih .eli-g-day { color: #1A237E; }

.eli-g-month {
  font-size: 0.6em;
}
.eli-date.badge-gurp .eli-g-month { color: var(--ev-gurp); }
.eli-date.badge-itih .eli-g-month { color: var(--ev-itih); }
.eli-date.badge-sang .eli-g-month { color: var(--ev-sang); }
.eli-date.badge-khas .eli-g-month { color: var(--ev-khas); }
.eli-date.badge-gran .eli-g-month { color: var(--ev-gran); }

.eli-info { flex-grow: 1; min-width: 0; }

.eli-name {
  font-weight: bold;
  font-size: 0.95em;
  color: var(--text);
  line-height: 1.4;
}
.eli-type {
  font-size: 0.75em;
  margin-top: 3px;
}
.eli-type.type-gurp { color: var(--ev-gurp); }
.eli-type.type-itih { color: var(--ev-itih); }
.eli-type.type-sang { color: var(--ev-sang); }
.eli-type.type-khas { color: var(--ev-khas); }
.eli-type.type-gran { color: var(--ev-gran); }

.eli-arrow {
  color: var(--text-muted);
  font-size: 1.2em;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   MISC / EXISTING — Event pages, cards, etc.
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.card h1 { color: var(--gold); font-size: 1.8em; margin-bottom: 10px; }

.event-page { max-width: 800px; margin: 30px auto; padding: 0 16px; }

.gurbani-quote {
  font-size: 1.3em;
  color: var(--gold);
  font-weight: bold;
  text-align: center;
  margin: 25px 0;
  padding: 20px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  line-height: 1.6;
}

.history-content {
  font-size: 1.05em;
  line-height: 1.8;
  color: var(--text);
}
.history-content h3 {
  color: var(--gold);
  margin-top: 25px;
  margin-bottom: 12px;
}

.hero-date {
  font-size: 2.2em;
  color: var(--gold);
  font-weight: 800;
}

.event-tag {
  font-size: 0.8em;
  padding: 8px 12px;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  display: inline-block;
}
.event-tag.itih { background: var(--ev-itih); }
.event-tag.gurp { background: var(--ev-gurp); }
.event-tag.sang { background: var(--ev-sang); }
.event-tag.khas { background: var(--ev-khas); }

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85em;
}

/* ── Language toggle ─────────────────────────────────────── */
.en-text { display: none; }
.lang-en .pa-text { display: none; }
.lang-en .en-text { display: block; }
.lang-en span.pa-text, .lang-en a.pa-text { display: none; }
.lang-en span.en-text, .lang-en a.en-text { display: inline; }
span.en-text, a.en-text { display: none; }
/* Keep div.en-text hidden by default but show as flex for event-list-item */
.lang-en div.en-text { display: block; }
.lang-en .eli-name.en-text { display: block; }
.lang-en .eli-type.en-text { display: block; }

/* ── Responsive — mobile still shows 7-col grid ─────────── */
@media (max-width: 600px) {
  .real-calendar { gap: 2px; padding: 2px 2px 6px; }
  .cal-day { padding: 6px 1px; min-height: 56px; }
  .cal-day .greg-day { font-size: 1em; }
  .cal-day .nanak-day { font-size: 0.5em; }
  .cal-header { font-size: 0.7em; padding: 8px 0; }
  .main-header h1 { font-size: 1.1em; }
  .month-header h2 { font-size: 1.5em !important; }
  .eli-name { font-size: 0.85em; }
  .card { padding: 20px; }
}

/* Today Highlight */
.cal-day.is-today {
  border: 2px solid var(--gold) !important;
  background-color: rgba(255, 160, 0, 0.15) !important;
  border-radius: 8px;
  position: relative;
}
.cal-day.is-today::after {
  content: 'ਅੱਜ';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold);
  color: white;
  font-size: 0.6em;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}
.lang-en .cal-day.is-today::after {
  content: 'Today';
}

/* Anti-Copy Text Selection Disable */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
}

