/* ==========================================================================
   Gujarati Calendar Mitra - Monthly Calendar Grid Styles
   ========================================================================== */

.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-main-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.calendar-sidebar-column {
  width: 100%;
}

@media (min-width: 992px) {
  .calendar-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
  }
  .calendar-sidebar-column {
    position: sticky;
    top: 86px;
  }
  .calendar-grid {
    gap: 8px !important;
  }
  .date-cell {
    aspect-ratio: auto !important;
    min-height: 96px !important;
    padding: 6px 5px 6px 5px !important;
    border-radius: var(--radius-md) !important;
    justify-content: flex-start !important;
    gap: 2px !important;
  }
  .cell-top {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 3px !important;
  }
  .gregorian-num {
    font-size: 17px !important;
  }
  .tithi-label {
    font-size: 11px !important;
    font-weight: 700 !important;
  }
  .cell-bottom {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .cell-tehvar-badge {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    letter-spacing: 0 !important;
    width: 100% !important;
  }
  .cell-tehvar-badge.long-text {
    font-size: 9px !important;
  }
  .cell-footer-icons {
    height: 14px !important;
    gap: 4px !important;
  }
  .cell-dot {
    width: 6px !important;
    height: 6px !important;
  }
  .moon-icon {
    font-size: 12px !important;
  }
}

/* Month Navigation & Vikram Samvat Banner */
.calendar-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.calendar-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-saffron), var(--primary-gold), var(--accent-vermillion));
}

.month-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.month-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.month-nav-btn:hover {
  background: var(--primary-saffron);
  color: #ffffff;
  border-color: var(--primary-saffron);
}
.month-nav-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.month-title-wrap {
  text-align: center;
}
.gregorian-month-title {
  font-family: var(--font-english);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gujarati-month-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-gold);
  background: rgba(255, 179, 0, 0.12);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  border: 1px solid rgba(255, 179, 0, 0.25);
}

.samvat-subrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px 2px 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-secondary);
  gap: 8px;
  flex-wrap: wrap;
}

.cal-today-btn {
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(230, 81, 0, 0.3);
}

.samvat-tag {
  color: var(--text-gold);
  font-weight: 600;
}

/* Calendar Weekday Header */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 700;
}
.weekday-col {
  padding: 6px 0;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
}
.weekday-col.sunday {
  color: #ef4444; /* Sunday special highlight */
}

/* Calendar Dates Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.date-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 58px;
  aspect-ratio: 1 / 1.22;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3px 1px 2px 1px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  overflow: hidden;
}
.date-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.date-cell.other-month {
  opacity: 0.28;
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}
.date-cell.sunday .gregorian-num {
  color: #ef4444;
}

/* Today & Selected Date Styles */
.date-cell.today {
  border: 1.5px solid var(--primary-gold);
  background: rgba(255, 179, 0, 0.08);
}
.date-cell.today .gregorian-num {
  color: var(--primary-gold);
  font-weight: 800;
}
.date-cell.has-tehvar {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.04);
}
.date-cell.selected {
  background: linear-gradient(135deg, var(--primary-saffron) 0%, var(--accent-vermillion) 100%) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(230, 81, 0, 0.45);
  transform: scale(1.04);
  z-index: 2;
}
.date-cell.selected .gregorian-num,
.date-cell.selected .tithi-label,
.date-cell.selected .moon-icon {
  color: #ffffff !important;
}

/* Cell Top & Bottom Containers */
.cell-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  line-height: 1;
}
.cell-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1px;
}

/* Gregorian Day Number */
.gregorian-num {
  font-family: var(--font-english);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Gujarati Tithi Label inside Cell */
.tithi-label {
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-secondary);
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1px;
}
.tithi-label.sud {
  color: #38bdf8; /* Shukla Paksha */
}
.tithi-label.vad {
  color: #fbbf24; /* Krishna Paksha */
}
.tithi-label.ekadashi {
  color: #f43f5e; /* Ekadashi Vrat */
  font-weight: 700;
}

/* Major Tehvar Badge on Calendar Date */
.cell-tehvar-badge {
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: calc(100% - 2px);
  box-sizing: border-box;
  padding: 1px 1px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: -0.2px;
}
.cell-tehvar-badge.long-text {
  font-size: 7.2px;
  letter-spacing: -0.35px;
}
.cell-tehvar-badge.festival {
  background: linear-gradient(135deg, rgba(230, 81, 0, 0.25), rgba(245, 158, 11, 0.3));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.55);
}
.cell-tehvar-badge.holiday {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}
.cell-tehvar-badge.vrat {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.cell-tehvar-badge.shraddha {
  background: rgba(180, 83, 9, 0.28);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.6);
}
[data-mode="light"] .cell-tehvar-badge.festival {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
[data-mode="light"] .cell-tehvar-badge.holiday {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
[data-mode="light"] .cell-tehvar-badge.vrat {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
[data-mode="light"] .cell-tehvar-badge.shraddha {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.date-cell.selected .cell-tehvar-badge {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Website-only Astrological Information inside Calendar Date Cell */
.cell-astro-website {
  display: none;
}

html.is-website .cell-astro-website,
.is-website .cell-astro-website {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin: 2px 0;
  box-sizing: border-box;
}

html.is-native-app .cell-astro-website,
.is-native-app .cell-astro-website {
  display: none !important;
}

@media (max-width: 768px) {
  .cell-astro-website {
    display: none !important;
  }
}

.cell-sun-times {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-english);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.cell-sun-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cell-sun-item .sun-ico {
  font-size: 9px;
  line-height: 1;
}

.cell-sun-sep {
  opacity: 0.4;
  font-size: 8px;
}

.cell-rashi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-gold);
  background: rgba(255, 179, 0, 0.09);
  border: 1px solid rgba(255, 179, 0, 0.24);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-mode="light"] .cell-sun-times {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

[data-mode="light"] .cell-rashi {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.date-cell.selected .cell-sun-times {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  color: #ffffff !important;
}

.date-cell.selected .cell-rashi {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #ffffff !important;
}

/* Multiple Tehvar Badges List inside Date Cell */
.cell-tehvar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  align-items: stretch;
}

/* Moon Phase & Festival Dots */
.cell-footer-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 9px;
}
.cell-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.cell-dot.festival {
  background: #f59e0b;
}
.cell-dot.holiday {
  background: #ef4444;
}
.cell-dot.vrat {
  background: #10b981;
}
.cell-dot.shraddha {
  background: #d97706;
}
.moon-icon {
  font-size: 8px;
  line-height: 1;
}

/* Selected Date Detail Drawer Panel */
.selected-date-detail {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 4px;
  box-shadow: var(--shadow-md);
  animation: fadeInScale 0.2s ease-out;
}
.detail-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.detail-title-guj {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-gold);
}
.detail-title-eng {
  font-family: var(--font-english);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Selected Date Precise Tithi Timing Box */
.selected-date-tithi-timing-box {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.08), rgba(230, 81, 0, 0.09));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-mode="light"] .selected-date-tithi-timing-box {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.tithi-timing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tithi-timing-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-gold);
}

.tithi-timing-icon {
  font-size: 13px;
}

.tithi-timing-current-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.tithi-timing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  gap: 6px;
}

.tithi-time-slot {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tithi-slot-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tithi-slot-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
}

.tithi-time-slot.end .tithi-slot-val {
  color: var(--primary-gold);
}

.tithi-time-sep {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tithi-next-subrow {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  flex-wrap: wrap;
}

.tithi-next-subrow .tithi-next-lbl {
  color: var(--text-muted);
  font-weight: 600;
}

.tithi-next-subrow .tithi-next-val {
  color: var(--text-secondary);
}

/* Grid of mini astrological metrics */
.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.metric-box {
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}
.metric-box .label {
  font-size: 11px;
  color: var(--text-muted);
}
.metric-box .val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Special Events / Festivals Tag List */
.detail-events-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.event-tag {
  background: rgba(230, 81, 0, 0.15);
  border: 1px solid rgba(230, 81, 0, 0.35);
  color: #ff9800;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}
.event-tag.holiday {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.event-tag.vrat {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.event-tag.shraddha {
  background: rgba(180, 83, 9, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}
.event-tag-tithi {
  font-size: 10.5px;
  opacity: 0.88;
  font-weight: 500;
}

[data-mode="light"] .event-tag {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

[data-mode="light"] .event-tag.holiday {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

[data-mode="light"] .event-tag.vrat {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

[data-mode="light"] .event-tag.shraddha {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

/* Quick Action Buttons on Selected Date */
.detail-actions-row {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.quick-jump-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.quick-jump-btn:hover {
  background: var(--primary-saffron);
  border-color: var(--primary-saffron);
  color: #ffffff;
}
.quick-jump-btn.primary {
  background: linear-gradient(135deg, var(--primary-saffron), var(--accent-vermillion));
  border: none;
  color: #ffffff;
}

/* Sacred Vrat Katha Card inside Selected Date Details Drawer */
.selected-date-katha-card {
  background: linear-gradient(135deg, rgba(230, 81, 0, 0.12), rgba(255, 179, 0, 0.08));
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.selected-date-katha-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-gold), var(--primary-saffron));
  z-index: 2;
}
.selected-date-katha-card:hover {
  border-color: var(--primary-gold);
  transform: translateY(-1px);
}
.katha-card-media {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
}
.katha-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.4s ease;
}
.katha-card-media:hover .katha-card-img {
  transform: scale(1.04);
}
.katha-card-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.75) 100%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 10px;
}
.katha-badge-glow {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(230, 81, 0, 0.85);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.katha-tithi-tag-overlay {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffca28;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 179, 0, 0.4);
}
.katha-card-content {
  padding: 10px 12px 12px 12px;
}
.katha-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 0 12px;
  margin-bottom: 6px;
}
.katha-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}
.katha-tithi-tag {
  font-size: 11px;
  background: rgba(255, 179, 0, 0.15);
  color: #ffca28;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 179, 0, 0.25);
}
.katha-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}
.katha-card-snippet {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.katha-read-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-gold), #d97706);
  color: #0c0f17;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.25);
  transition: all var(--transition-fast);
}
.katha-read-btn:hover {
  background: linear-gradient(135deg, #ffd54f, var(--primary-gold));
  box-shadow: 0 4px 14px rgba(255, 179, 0, 0.4);
  transform: translateY(-1px);
}
.quick-jump-btn.katha-btn {
  background: rgba(255, 179, 0, 0.12);
  border-color: rgba(255, 179, 0, 0.4);
  color: var(--primary-gold);
}
.quick-jump-btn.katha-btn:hover {
  background: var(--primary-gold);
  color: #0c0f17;
  border-color: var(--primary-gold);
}

[data-mode="light"] .selected-date-katha-card {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
[data-mode="light"] .katha-badge {
  color: #b45309;
}
[data-mode="light"] .katha-tithi-tag {
  background: rgba(230, 81, 0, 0.08);
  color: #b45309;
  border-color: rgba(230, 81, 0, 0.25);
}


