/* ==========================================================================
   DAY DETAIL & GOOD/BAD DAYS (XEM NGÀY TỐT XẤU) STYLES
   ========================================================================== */

/* Good / Bad Card Container */
.good-bad-section {
  padding-block: clamp(24px, 4vw, 44px);
}

.good-bad-card {
  background: var(--surface, #ffffff);
  border: 1px solid #1c7442;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 110, 51, 0.08);
}

.good-bad-card__header {
  background: #006e33;
  color: #ffffff;
  padding: 14px 20px;
  text-align: center;
}

.good-bad-card__header h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.good-bad-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 2-Column Clean Table */
.good-bad-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  background: #ffffff;
}

.good-bad-table tr {
  border-bottom: 1px solid #c7e2d2;
}

.good-bad-table tr:last-child {
  border-bottom: none;
}

.good-bad-col-title {
  width: 170px;
  min-width: 140px;
  background: #f7faf8;
  color: #0b532c;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  padding: 14px 16px;
  border-right: 1px solid #c7e2d2;
  font-size: 15px;
  line-height: 1.4;
}

.good-bad-col-desc {
  padding: 14px 20px;
  color: #242924;
  vertical-align: top;
}

.good-bad-col-desc p {
  margin: 0 0 8px;
}

.good-bad-col-desc p:last-child {
  margin-bottom: 0;
}

/* Badges & Status */
.good-day-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--success {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #b7e1cd;
}

.badge--warning {
  background: #fef7e0;
  color: #b06000;
  border: 1px solid #fce8b2;
}

.badge--danger {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
}

.taboo-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.taboo-list li {
  margin-bottom: 6px;
}

/* Ancient Poem Quotes */
.ancient-poem {
  margin: 10px 0;
  padding: 10px 16px;
  background: #fbf9f4;
  border-left: 3px solid #b98638;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #4a453a;
}

.ancient-poem p {
  margin: 0;
  line-height: 1.6;
}

.highlight-good {
  color: #137333;
}

.highlight-bad {
  color: #b3261e;
}

.mansion-exception {
  margin: 8px 0;
  padding: 8px 12px;
  background: #fdfaf3;
  border: 1px dashed #d8c29d;
  border-radius: 6px;
  font-size: 14px;
}

.ngoc-hap-group {
  margin-bottom: 10px;
}

.ngoc-hap-group:last-child {
  margin-bottom: 0;
}

.ngoc-hap-group ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.ngoc-hap-group li {
  margin-bottom: 4px;
}

/* Lý Thuần Phong Hours */
.ly-thuan-phong-list {
  display: grid;
  gap: 8px;
}

.ltp-item {
  padding: 8px 12px;
  background: #fafaf7;
  border: 1px solid #ece9df;
  border-radius: 6px;
}

.ltp-item__time {
  margin: 0 0 4px;
  color: #1a4736;
}

.ltp-item__desc {
  margin: 0;
  font-size: 14px;
  color: #555c54;
}

/* ==========================================================================
   PAGE-DAY TEMPLATE STYLES (/nam/YYYY/thang/M/ngay/D)
   ========================================================================== */

.day-page-main {
  padding-bottom: 60px;
}

/* Breadcrumbs */
.day-breadcrumbs {
  padding-block: 16px;
  font-size: 14px;
  color: var(--muted, #666b63);
}

.day-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.day-breadcrumbs li + li::before {
  content: "›";
  margin-right: 6px;
  color: #999;
}

.day-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.day-breadcrumbs a:hover {
  color: #006e33;
  text-decoration: underline;
}

.day-breadcrumbs [aria-current="page"] {
  color: #006e33;
  font-weight: 600;
}

/* Date Navigator Bar */
.day-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #dad8cf;
  border-radius: 8px;
}

.day-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f4f3ec;
  color: #20241f;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.day-nav-btn:hover {
  background: #006e33;
  color: #ffffff;
}

.day-nav-current {
  font-weight: 700;
  font-size: clamp(15px, 1.8vw, 18px);
  color: #1a4736;
  text-align: center;
}

/* Dual Day Hero Cards */
.day-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.day-card {
  background: #ffffff;
  border: 1px solid #dad8cf;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
}

.day-card--solar {
  border-top: 5px solid #006e33;
}

.day-card--lunar {
  border-top: 5px solid #a62c2b;
}

.day-card__label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #666b63;
}

.day-card--solar .day-card__label {
  color: #006e33;
}

.day-card--lunar .day-card__label {
  color: #a62c2b;
}

.day-card__number {
  font-size: clamp(52px, 8vw, 76px);
  font-weight: 900;
  line-height: 1;
  margin: 0 0 10px;
  font-family: var(--font-display, inherit);
}

.day-card--solar .day-card__number {
  color: #006e33;
}

.day-card--lunar .day-card__number {
  color: #a62c2b;
}

.day-card__meta {
  font-size: 15px;
  color: #444a42;
  display: grid;
  gap: 4px;
}

.day-card__meta strong {
  color: #1a1e19;
}

/* Day Mini Calendar Section */
.day-month-calendar {
  margin-bottom: 32px;
  background: #ffffff;
  border: 1px solid #dad8cf;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.day-month-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.day-month-calendar__header h3 {
  margin: 0;
  font-size: 18px;
  color: #006e33;
  font-weight: 800;
  text-transform: uppercase;
}

.day-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-month-grid__head {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #666b63;
  padding-block: 6px;
  background: #f7f6f0;
  border-radius: 4px;
}

.day-month-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid #eae8df;
  border-radius: 6px;
  text-decoration: none;
  color: #20241f;
  padding: 4px 2px;
  transition: all 0.15s ease;
  position: relative;
}

.day-month-cell:hover {
  background: #e2ece6;
  border-color: #006e33;
}

.day-month-cell strong {
  font-size: 15px;
  line-height: 1.1;
}

.day-month-cell small {
  font-size: 11px;
  color: #666b63;
  margin-top: 2px;
}

.day-month-cell--empty {
  border: none;
  background: transparent;
  pointer-events: none;
}

.day-month-cell.is-selected {
  background: #006e33;
  color: #ffffff;
  border-color: #006e33;
}

.day-month-cell.is-selected small {
  color: #d1f2dd;
}

.day-month-cell.is-today:not(.is-selected) {
  border: 2px solid #006e33;
  background: #edf7f0;
}

.day-month-cell.is-sunday strong {
  color: #a62c2b;
}

.day-month-cell.is-selected strong {
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .good-bad-col-title {
    width: 120px;
    padding: 10px 8px;
    font-size: 14px;
  }
  .good-bad-col-desc {
    padding: 10px 14px;
    font-size: 14px;
  }
  .day-month-cell {
    min-height: 42px;
  }
  .day-month-cell strong {
    font-size: 13px;
  }
  .day-month-cell small {
    font-size: 10px;
  }
}

@media (max-width: 540px) {
  .good-bad-table tr {
    display: flex;
    flex-direction: column;
  }
  .good-bad-col-title {
    width: 100%;
    border-right: none;
    border-bottom: 1px dashed #c7e2d2;
    text-align: left;
    padding: 8px 14px;
    background: #eaf4ee;
  }
  .good-bad-col-desc {
    padding: 12px 14px;
  }
}

/* ==========================================================================
   MONTH & YEAR CALENDAR PAGES STYLES
   ========================================================================== */

.calendar-page-main {
  padding-bottom: clamp(32px, 5vw, 60px);
}

.calendar-hero-header {
  margin-bottom: 24px;
}

.calendar-page-title {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  color: #0b532c;
  margin: 0 0 10px;
  line-height: 1.25;
}

.calendar-page-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.badge-canchi {
  background: #006e33;
  color: #ffffff;
}

.badge-napam {
  background: #1976d2;
  color: #ffffff;
}

.badge-leap {
  background: #e65100;
  color: #ffffff;
}

.badge-solar {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #bbdefb;
}

.badge-lunar {
  background: #fbe9e7;
  color: #bf360c;
  border: 1px solid #ffccbc;
}

.calendar-page-intro {
  font-size: 15px;
  line-height: 1.6;
  color: #444c46;
  margin: 0 0 16px;
}

.year-zodiac-box {
  background: #f4faf6;
  border-left: 4px solid #006e33;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-top: 12px;
}

.year-zodiac-box p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #2b332d;
}

/* Month Navigation Bar */
.month-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #c7e2d2;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 110, 51, 0.05);
}

.month-nav-title h2 {
  margin: 0;
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 800;
  color: #006e33;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Calendar Legend */
.calendar-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: #f7faf8;
  border-radius: 8px;
  border: 1px solid #e1eee6;
  font-size: 13.5px;
}

.text-good {
  color: #d32f2f;
}

.text-bad {
  color: #6a1b9a;
}

/* VN Calendar Table (Month Page) */
.calendar-table-wrap {
  background: #ffffff;
  border: 1px solid #c7e2d2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 110, 51, 0.06);
  margin-bottom: 32px;
  padding: 16px;
}

.vncal-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
  background: #ffffff;
}

.vncal-table thead th {
  background: #006e33;
  color: #ffffff;
  padding: 12px 6px;
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid #005a28;
}

.vncal-table tbody td {
  border: 1px solid #dbe8e0;
  padding: 0;
  vertical-align: top;
  height: clamp(65px, 8vw, 95px);
  background: #ffffff;
  transition: background 0.15s ease;
}

.vncal-table tbody td.skip {
  background: #f8faf8;
}

.vncal-cell a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 6px 4px;
  text-decoration: none;
  color: inherit;
}

.vncal-cell:hover {
  background: #eef7f2;
}

.vncal-cell.is-today {
  background: #fff9e6;
  outline: 2px solid #f59f00;
  outline-offset: -2px;
}

.vncal-cell .dao {
  font-size: 10px;
  line-height: 1;
}

.vncal-cell .dao.tot,
.dao-dot.dao-tot {
  color: #d32f2f;
}

.vncal-cell .dao.xau,
.dao-dot.dao-xau {
  color: #6a1b9a;
}

.vncal-cell .duong {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 800;
  color: #1a221d;
  line-height: 1.1;
  margin: 2px 0;
}

.vncal-cell .duong.sun {
  color: #d32f2f;
}

.vncal-cell .duong.sat {
  color: #006e33;
}

.vncal-cell .am {
  font-size: 12px;
  color: #555e58;
  line-height: 1.2;
}

.vncal-cell .am.am-highlight {
  color: #d32f2f;
  font-weight: 700;
}

.vncal-cell .am-canchi {
  display: block;
  font-size: 11px;
  color: #727c75;
  margin-top: 1px;
}

/* 12-Month Grid (Year Page) */
.year-grid-12 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.year-month-card {
  background: #ffffff;
  border: 1px solid #c7e2d2;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 110, 51, 0.05);
  display: flex;
  flex-direction: column;
}

.year-month-card__header {
  background: #006e33;
  padding: 8px 12px;
  text-align: center;
}

.year-month-card__header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.year-month-card__header a {
  color: #ffffff;
  text-decoration: none;
}

.year-month-card__header a:hover {
  text-decoration: underline;
}

.year-month-card__table-wrap {
  padding: 6px;
  flex: 1;
}

.vncal-table--mini thead th {
  padding: 4px 2px;
  font-size: 11px;
  background: #005a28;
}

.vncal-table--mini tbody td {
  height: 48px;
  border-color: #e5ede8;
}

.vncal-table--mini .vncal-cell a {
  padding: 2px 1px;
}

.vncal-table--mini .duong {
  font-size: 13px;
  font-weight: 700;
}

.vncal-table--mini .am {
  font-size: 10px;
}

.vncal-table--mini .dao {
  font-size: 8px;
}

/* Month Lists Section */
.month-lists-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.month-list-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #c7e2d2;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 110, 51, 0.05);
}

.month-list-card--good {
  border-top: 4px solid #006e33;
}

.month-list-card--bad {
  border-top: 4px solid #6a1b9a;
}

.month-list-card__header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7faf8;
  border-bottom: 1px solid #e1eee6;
}

.month-list-card--good .month-list-card__header {
  color: #006e33;
}

.month-list-card--bad .month-list-card__header {
  color: #6a1b9a;
}

.month-list-card__header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.day-pills-list {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.day-pill--good {
  background: #eef7f2;
  color: #006e33;
  border: 1px solid #c7e2d2;
}

.day-pill--good:hover {
  background: #006e33;
  color: #ffffff;
}

.day-pill--bad {
  background: #f6edf9;
  color: #6a1b9a;
  border: 1px solid #e1cbe8;
}

.day-pill--bad:hover {
  background: #6a1b9a;
  color: #ffffff;
}

.day-pill__date {
  font-weight: 700;
}

.day-pill__canchi {
  font-size: 12px;
  opacity: 0.9;
}

.day-pill__badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 110, 51, 0.12);
  font-weight: 600;
}

.day-pill--bad .day-pill__badge {
  background: rgba(106, 27, 154, 0.12);
}

.day-pill:hover .day-pill__badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Holidays & Generic Section Cards */
.section-card {
  background: #ffffff;
  border: 1px solid #c7e2d2;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 110, 51, 0.05);
}

.section-card__header {
  background: #006e33;
  color: #ffffff;
  padding: 12px 18px;
}

.section-card__header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
}

.section-card__body {
  padding: 16px 18px;
}

.holidays-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.holiday-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eef2ef;
  font-size: 14.5px;
}

.holiday-item:last-child {
  border-bottom: none;
}

.holiday-item__lunar {
  color: #666;
  font-size: 13px;
  margin-left: 6px;
}

.holidays-table-wrap {
  overflow-x: auto;
}

.holidays-full-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.holidays-full-table th {
  background: #f4faf6;
  color: #006e33;
  padding: 10px 14px;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid #c7e2d2;
}

.holidays-full-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef2ef;
  vertical-align: middle;
}

.holiday-col-solar a {
  color: #006e33;
  text-decoration: none;
}

.holiday-col-solar a:hover {
  text-decoration: underline;
}

/* Khong Minh Departure List */
.departure-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.departure-item {
  padding: 8px 0;
  border-bottom: 1px dashed #e5ece7;
  font-size: 14px;
  line-height: 1.5;
}

.departure-item:last-child {
  border-bottom: none;
}

.departure-item__lead {
  margin-bottom: 2px;
}

.departure-item__link {
  color: #006e33;
  text-decoration: none;
}

.departure-item__link:hover {
  text-decoration: underline;
}

.departure-item__desc {
  color: #4a544c;
  font-size: 13.5px;
}

/* Month Switcher Pills */
.months-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.month-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  background: #f0f7f2;
  color: #006e33;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  border: 1px solid #d0e4d7;
  transition: all 0.15s ease;
}

.month-pill:hover,
.month-pill.is-active {
  background: #006e33;
  color: #ffffff;
  border-color: #006e33;
}

/* Year Jump Group & Form */
.year-pills-group {
  margin-bottom: 16px;
}

.year-pills-group__title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #0b532c;
  margin-bottom: 8px;
}

.year-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.year-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 4px;
  background: #f0f7f2;
  color: #005a28;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #d0e4d7;
  transition: all 0.15s ease;
}

.year-pill:hover,
.year-pill.is-active {
  background: #006e33;
  color: #ffffff;
  border-color: #006e33;
}

.year-jump-form-wrap {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #c7e2d2;
}

.year-jump-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.year-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-input-group input {
  width: 110px;
  padding: 6px 12px;
  border: 1px solid #c7e2d2;
  border-radius: 4px;
  font-size: 14px;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
  .year-grid-12 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .month-lists-grid {
    grid-template-columns: 1fr;
  }
  .vncal-table tbody td {
    height: 58px;
  }
  .vncal-cell .am-canchi {
    display: none;
  }
}

@media (max-width: 580px) {
  .year-grid-12 {
    grid-template-columns: 1fr;
  }
  .month-nav-bar {
    flex-direction: column;
    text-align: center;
  }
}
