/* VN Lunar Calendar styles */
:root {
  --vnlc-red: #b10f1c;
  --vnlc-gold: #c9a648;
  --vnlc-bg: #f7f2e9;
  --vnlc-border: #d8d3c4;
  --vnlc-text: #2c1c0f;
  --vnlc-muted: #6a5542;
  --vnlc-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.vn-lunar-calendar {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--vnlc-bg);
  border: 1px solid var(--vnlc-border);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--vnlc-shadow);
  color: var(--vnlc-text);
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
}

/* Tabs */
.vnlc-tabs {
  display: flex;
  background: var(--vnlc-red);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.vnlc-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.vnlc-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.vnlc-tab.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-bottom-color: #fff;
}

/* Tab Content */
.vnlc-tab-content {
  display: none;
  padding: 12px;
}

.vnlc-tab-content.active {
  display: block;
}

.vnlc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--vnlc-red);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.vnlc-month-year {
  text-align: center;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex: 1;
}

.vnlc-month-year .vnlc-month-header {
  text-transform: uppercase;
}

.vnlc-month-year .vnlc-year-header {
  font-size: 1.1em;
}

.vnlc-month-year .vnlc-day-header {
  font-size: 0.9em;
  opacity: 0.95;
}

.vnlc-nav {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
}

.vnlc-calendar {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--vnlc-border);
  border-radius: 8px;
  overflow: hidden;
}

.vnlc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f1e7d7;
  font-weight: 700;
  text-align: center;
  padding: 8px 0;
  color: var(--vnlc-red);
}

.vnlc-weekday-cell {
  font-size: 13px;
  letter-spacing: 0.2px;
}

.vnlc-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px;
}

.vnlc-day-cell {
  min-height: 48px;
  border: 1px solid var(--vnlc-border);
  border-radius: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 600;
  color: var(--vnlc-text);
}

.vnlc-day {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.vnlc-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.vnlc-day.is-selected {
  border-color: var(--vnlc-red);
  box-shadow: 0 0 0 2px rgba(177, 15, 28, 0.15);
}

.vnlc-empty {
  background: #f9f6f0;
  border-style: dashed;
}

.vnlc-day-number {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.vnlc-lunar-day-number {
  font-size: 10px;
  color: var(--vnlc-red);
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.85;
  line-height: 1;
  min-height: 12px;
  display: block;
}

.vnlc-lunar-day-number:empty::before {
  content: "…";
  opacity: 0.3;
}

.vnlc-detail-card {
  background: #fff;
  border: 1px solid var(--vnlc-border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

@media (max-width: 768px) {
  .vnlc-detail-card {
    padding: 6px;
  }
}

.vnlc-detail-card.is-loading::after {
  content: "Đang tải...";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--vnlc-red);
  border-radius: 14px;
}

.vnlc-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(177, 15, 28, 0.05), rgba(177, 15, 28, 0.02));
  padding: 6px;
  border-radius: 6px;
}

.vnlc-top-left,
.vnlc-top-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  font-weight: 700;
  color: var(--vnlc-red);
  font-size: 13px;
}

.vnlc-year-label,
.vnlc-month-label {
  font-size: 12px;
}

.vnlc-big-day {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  text-align: center;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--vnlc-text);
}

.vnlc-weekday {
  font-size: 13px;
  letter-spacing: 0.3px;
}

.vnlc-quote-section {
  margin: 6px 2px;
  padding: 6px;
  background: rgba(177, 15, 28, 0.03);
  border-left: 2px solid var(--vnlc-red);
  border-radius: 4px;
}

.vnlc-quote-text {
  color: var(--vnlc-text);
  font-size: 11px;
  font-style: italic;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 3px;
}

/* Hide quote on mobile to save space */
@media (max-width: 768px) {
  .vnlc-quote-section {
    display: none;
  }
}

.vnlc-quote-author {
  color: var(--vnlc-muted);
  font-size: 11px;
  text-align: right;
  font-style: normal;
}

.vnlc-separator {
  height: 1px;
  background: var(--vnlc-border);
  margin: 6px 0;
}

.vnlc-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.vnlc-info-col {
  background: #f9f6f0;
  border: 1px solid var(--vnlc-border);
  border-radius: 6px;
  padding: 6px;
  min-height: auto;
}

.vnlc-label {
  font-weight: 700;
  color: var(--vnlc-red);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  font-size: 12px;
  text-transform: uppercase;
}

.vnlc-label-hours {
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 10px;
}

.vnlc-lunar-date {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--vnlc-text);
}

.vnlc-lunar-year,
.vnlc-lunar-can-chi-day {
  font-size: 11px;
  color: var(--vnlc-muted);
  margin-bottom: 3px;
}

.vnlc-can-chi-day,
.vnlc-can-chi-month,
.vnlc-can-chi-year {
  font-size: 11px;
  color: var(--vnlc-text);
  margin-bottom: 4px;
  padding: 2px 0;
}

.vnlc-hoang-dao-label {
  font-size: 13px;
  color: var(--vnlc-text);
  margin-bottom: 6px;
  padding: 4px 0;
}

.vnlc-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--vnlc-border);
  font-size: 12px;
  margin: 2px;
}

.vnlc-hour-chip {
  display: inline-block;
  text-align: center;
  padding: 3px 6px;
  margin: 2px 1px;
  line-height: 1.2;
  font-size: 10px;
}

.vnlc-hour-chip small {
  display: block;
  font-size: 8px;
  opacity: 0.8;
  margin-top: 1px;
}

.vnlc-chip.good {
  border-color: #0f9d58;
  color: #0f9d58;
  background: #e6f4ea;
}

.vnlc-chip.bad {
  border-color: #d93025;
  color: #d93025;
  background: #fdecea;
}

.vnlc-empty-msg {
  color: var(--vnlc-muted);
  font-size: 12px;
  font-style: italic;
  padding: 8px 0;
}

.vnlc-chi-hours,
.vnlc-hoang-dao {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

/* Limit hours display on mobile */
@media (max-width: 768px) {
  .vnlc-chi-hours,
  .vnlc-hoang-dao {
    max-height: 80px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .vnlc-chi-hours .vnlc-hour-chip,
  .vnlc-hoang-dao .vnlc-hour-chip {
    font-size: 9px;
    padding: 2px 5px;
  }
  
  .vnlc-chi-hours .vnlc-hour-chip small,
  .vnlc-hoang-dao .vnlc-hour-chip small {
    font-size: 7px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .vn-lunar-calendar {
    padding: 12px;
    border-radius: 12px;
  }

  .vnlc-header {
    padding: 8px 10px;
    border-radius: 8px;
  }

  .vnlc-nav {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .vnlc-month-year {
    font-size: 14px;
  }

  .vnlc-days {
    gap: 3px;
    padding: 6px;
  }

  .vnlc-day-cell {
    min-height: 40px;
    font-size: 13px;
  }

  .vnlc-day-number {
    font-size: 14px;
  }

  .vnlc-lunar-day-number {
    font-size: 9px;
  }

  .vnlc-top {
    grid-template-columns: 1fr;
    gap: 4px;
    text-align: center;
    padding: 4px;
  }

  .vnlc-big-day {
    font-size: 48px;
    order: -1;
  }

  .vnlc-year-label,
  .vnlc-month-label,
  .vnlc-weekday {
    font-size: 11px;
  }

  .vnlc-info-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .vnlc-info-col {
    min-height: auto;
    padding: 6px;
  }

  .vnlc-label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .vnlc-lunar-date {
    font-size: 13px;
  }

  .vnlc-lunar-year,
  .vnlc-lunar-can-chi-day,
  .vnlc-can-chi-day,
  .vnlc-can-chi-month,
  .vnlc-can-chi-year {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .vnlc-hoang-dao-label {
    font-size: 11px;
    margin-bottom: 4px;
    padding: 2px 0;
  }

  .vnlc-tabs {
    flex-direction: column;
  }

  .vnlc-tab {
    padding: 10px;
    font-size: 13px;
  }

  .vnlc-footer-nav {
    padding: 10px 12px;
  }
}

/* Footer Navigation */
.vnlc-footer-nav {
  background: var(--vnlc-red);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.vnlc-btn-today {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.vnlc-btn-today:hover {
  background: rgba(255, 255, 255, 0.25);
}
