:root { 
  --primary: #c0392b; 
  --primary-dark: #922b21;
  --gold: #f39c12;
  --bg: #0f172a; 
  --card: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

body.light-mode {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

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

.main-header { 
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
  color: white; 
  padding: 20px; 
  text-align: center; 
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.main-header h1 { margin: 0; font-size: 2.2em; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.nav-controls {
  position: absolute;
  right: 20px;
  top: 20px;
  display: flex;
  gap: 10px;
}

.icon-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  font-weight: bold;
}
.icon-btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-2px); }

.back-btn { 
  position: absolute; 
  left: 20px; 
  top: 20px; 
  color: white; 
  text-decoration: none; 
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 8px 12px; 
  border-radius: 8px; 
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-2px); }

/* Hero Section */
.hero-section {
  background: linear-gradient(to bottom right, var(--card), var(--bg));
  max-width: 1000px;
  margin: 30px auto;
  border-radius: 20px;
  padding: 40px 20px;
  text-align: center;
  border: 1px solid var(--gold);
  box-shadow: 0 10px 30px rgba(243, 156, 18, 0.1);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: 'ੴ';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 150px;
  opacity: 0.05;
  color: var(--gold);
  pointer-events: none;
}

.hero-date {
  font-size: 2.5em;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 10px;
}
.hero-events {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.hero-event-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: var(--text);
  font-size: 1.1em;
  max-width: 500px;
  width: 100%;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: -20px auto 30px auto;
  position: relative;
  z-index: 10;
}
.search-bar {
  width: 100%;
  padding: 15px 20px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.1em;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  outline: none;
  box-sizing: border-box;
}
.search-bar:focus { border-color: var(--gold); }

/* Jumps Links */

/* Search Bar */
.search-container {
    margin: 20px auto;
    max-width: 600px;
    padding: 0 15px;
}
#searchInput {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: var(--card);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
#searchInput:focus {
    border-color: var(--primary);
}
.search-results-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.search-result-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.search-result-card .date {
    font-size: 0.9em;
    color: var(--text-muted);
}
.search-result-card .title {
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    gap: 10px;
    align-items: center;
}

.jump-links { 
  background: var(--card); 
  padding: 20px; 
  border-radius: 16px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
  margin: 20px auto; 
  max-width: 1000px; 
  display: flex; 
  flex-wrap: wrap; 
  justify-content: center; 
  gap: 12px; 
  border: 1px solid var(--border);
}
.jump-links a { 
  text-decoration: none; 
  color: var(--text); 
  font-weight: 600; 
  padding: 8px 16px; 
  background: var(--bg);
  border: 1px solid var(--border); 
  border-radius: 20px; 
  font-size: 0.9em; 
  transition: all 0.3s; 
}
.jump-links a:hover { background: var(--primary); color: white; border-color: var(--primary); transform: translateY(-2px); }

/* Month Sections */
.month-section { 
  max-width: 1000px; 
  margin: 40px auto; 
  background: var(--card); 
  padding: 30px; 
  border-radius: 20px; 
  box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
  border: 1px solid var(--border);
}
.month-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 2px solid var(--border); 
  padding-bottom: 15px; 
  margin-bottom: 25px; 
}
.month-header h2 { margin: 0; color: var(--gold); font-size: 2em; }
.view-month-btn { 
  text-decoration: none; 
  color: white;
  font-weight: bold;
  background: var(--primary); 
  padding: 8px 16px; 
  border-radius: 8px; 
  transition: all 0.3s; 
}
.view-month-btn:hover { background: var(--primary-dark); transform: translateX(4px); }

/* Real Calendar Grid */
.real-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}
.cal-header {
    text-align: center; font-weight: bold; padding: 12px 0; background: var(--bg); border-radius: 8px; color: var(--text-muted);
}
.cal-empty { background: transparent; border: none; }
.cal-day {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}
.cal-day:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: var(--gold); }
.cal-day.has-event { border: 2px solid var(--gold); background: rgba(243, 156, 18, 0.05); }

.date-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--border); padding-bottom: 8px; margin-bottom: 8px; }
.n-day { font-size: 1.8em; font-weight: bold; color: var(--gold); }
.g-day { font-size: 0.85em; color: var(--text-muted); font-weight: bold; }

.events-list { display: flex; flex-direction: column; gap: 6px; }
.event-tag { 
  font-size: 0.75em; 
  padding: 6px 8px; 
  border-radius: 6px; 
  color: white; 
  text-decoration: none; 
  line-height: 1.4;
  font-weight: 500;
  transition: opacity 0.2s;
}
.event-tag:hover { opacity: 0.8; }
.event-tag.gurp { background: linear-gradient(to right, #b91d47, #901637); }
.event-tag.itih { background: linear-gradient(to right, #2b5797, #1e3c69); }
.event-tag.gran { background: linear-gradient(to right, #1e7145, #154f30); }
.event-tag.khas { background: linear-gradient(to right, #e3a21a, #c08916); }
.event-tag.sang { background: linear-gradient(to right, #da532c, #b64525); }

/* Post Content */
.post-content { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.card { 
  background: var(--card); 
  padding: 40px; 
  border-radius: 20px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.card h1 { color: var(--gold); font-size: 2.2em; margin-bottom: 10px; }

.event-type-badge.gurp { background: #8B0000; color: white; }
.event-type-badge.itih { background: #00008B; color: white; }
.event-type-badge.gran { background: #006400; color: white; }
.event-type-badge.khas { background: #CC7000; color: white; }
.event-type-badge.sang { background: #cc6600; color: white; }

.event-type-badge {
  display: inline-block;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
  margin-bottom: 20px;
}

.gurbani { 
  font-size: 1.4em; 
  color: var(--gold); 
  font-weight: bold; 
  font-style: italic; 
  text-align: center; 
  margin: 30px 0; 
  padding: 25px; 
  background: rgba(243, 156, 18, 0.1); 
  border-radius: 16px;
  border: 1px solid rgba(243, 156, 18, 0.3);
}
.history { font-size: 1.15em; line-height: 1.8; color: var(--text); }
.history h3 { color: var(--gold); margin-top:30px; margin-bottom: 15px; }

/* Language Toggle Logic */
.en-text { display: none; }
body.lang-en .pa-text { display: none; }
body.lang-en .en-text { display: block; }
/* Inline en/pa toggles */
body.lang-en span.pa-text, body.lang-en a.pa-text { display: none; }
body.lang-en span.en-text, body.lang-en a.en-text { display: inline; }
span.en-text, a.en-text { display: none; }

@media (max-width: 768px) {
    .real-calendar { grid-template-columns: repeat(1, 1fr); }
    .cal-header, .cal-empty { display: none; }
    .cal-day { min-height: auto; }
    .card { padding: 20px; }
    .hero-date { font-size: 1.8em; }
}
  