@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #1e7e34;
  --primary-dark: #155d26;
  --primary-light: #28a745;
  --secondary: #f0f7f2;
  --accent: #e6a817;
  --accent-light: #f5c842;
  --bg: #ffffff;
  --bg-alt: #f8faf8;
  --text: #1a1a1a;
  --text-secondary: #444444;
  --text-muted: #777777;
  --border: #d4e5d8;
  --shadow: 0 2px 8px rgba(30, 126, 52, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 126, 52, 0.1);
  --shadow-lg: 0 8px 24px rgba(30, 126, 52, 0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
  --success: #27ae60;
  --error: #c0392b;
  --weekend: #c0392b;
  --holiday: #c0392b;
  --good-day: #e6a817;
}

.dark {
  --primary: #28a745;
  --primary-dark: #1e7e34;
  --primary-light: #48c764;
  --secondary: #1a2e1e;
  --accent: #f5c842;
  --bg: #111a13;
  --bg-alt: #1a2e1e;
  --text: #e8f5e9;
  --text-secondary: #a5c8ad;
  --text-muted: #6b8f72;
  --border: #2d4a33;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.lvn-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.lvn-header {
  background: var(--primary);
  color: white;
  padding: 12px 0;
  margin-top: 20px;
  border-radius: var(--radius);
}

.lvn-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lvn-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lvn-header-logo-img {
  border-radius: 4px;
}

.lvn-header-logo {
  font-size: 1.375rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

.lvn-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.dark-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

/* Hero - Thông tin ngày */
.hero {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 20px auto;
  max-width: 1100px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
}

.hero-inner {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.hero-main {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.hero-solar {
  flex: 1;
  text-align: center;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-solar-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hero-solar-day {
  font-size: 5.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin: 4px 0;
}

.hero-solar-detail {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-solar-holiday {
  font-size: 0.875rem;
  color: var(--holiday);
  font-weight: 600;
  margin-top: 4px;
}

.hero-divider {
  width: 1px;
  background: var(--border);
  margin: 0 20px;
}

.hero-lunar {
  flex: 1;
  text-align: center;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-lunar-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hero-lunar-day {
  font-size: 5.5rem;
  font-weight: 900;
  color: var(--holiday);
  line-height: 1;
  margin: 4px 0;
}

.hero-lunar-detail {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-lunar-note {
  font-size: 0.875rem;
  color: var(--holiday);
  font-weight: 600;
  margin-top: 4px;
}

/* Hero Info */
.hero-info-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 auto 20px;
  max-width: 1100px;
  padding: 18px 28px;
  box-shadow: var(--shadow);
}

.hero-info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text);
}

.hero-info-row strong {
  color: var(--text);
  font-weight: 600;
  min-width: 120px;
}

.hero-info-row span {
  color: var(--text-secondary);
}

/* Calendar Section */
.calendar-wrapper {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 auto 20px;
  max-width: 1100px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cal-nav-btn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.cal-nav-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.cal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.cal-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.cal-select {
  padding: 7px 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.cal-select:focus {
  border-color: var(--primary-dark);
}

.cal-today-btn {
  padding: 7px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
  white-space: nowrap;
  text-transform: uppercase;
}

.cal-today-btn:hover {
  background: var(--primary-dark);
}

/* Calendar Grid */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 2px solid var(--primary);
  margin-bottom: 0;
}

.weekday-label {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 10px 4px;
}

.weekday-label.weekend-label {
  color: var(--weekend);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.calendar-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  min-height: 95px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.calendar-cell:hover {
  background: var(--secondary);
}

.calendar-cell .solar-day {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.calendar-cell .lunar-day {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
  position: absolute;
  top: 8px;
  right: 10px;
}

.calendar-cell .canchi-day {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: auto;
}

.calendar-cell .holiday-name {
  font-size: 0.6875rem;
  color: var(--holiday);
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.3;
  max-width: 100%;
}

.calendar-cell.other-month .solar-day {
  color: var(--text-muted);
  opacity: 0.5;
}

.calendar-cell.other-month .lunar-day,
.calendar-cell.other-month .canchi-day {
  opacity: 0.4;
}

.calendar-cell.other-month .holiday-name {
  opacity: 0.4;
}

.calendar-cell.today {
  background: #fff9e6;
}

.calendar-cell.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #e8f5ec;
}

.dark .calendar-cell.selected {
  background: #1a3a20;
}

.dark .calendar-cell.today {
  background: #2a2a10;
}

.calendar-cell.today .solar-day {
  color: var(--primary);
}

.calendar-cell.weekend .solar-day {
  color: var(--weekend);
}

.calendar-cell.today.weekend .solar-day {
  color: var(--primary);
}

.calendar-cell.holiday .solar-day {
  color: var(--holiday);
}

.calendar-cell .good-dot {
  position: absolute;
  top: 12px;
  right: 32px;
  width: 7px;
  height: 7px;
  background: var(--good-day);
  border-radius: 50%;
}

.calendar-cell.sunday .solar-day {
  color: var(--weekend);
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.today-dot { background: var(--primary); }
.holiday-dot { background: var(--holiday); }
.good-dot-legend { background: var(--good-day); }

/* Sidebar */
.sidebar-section {
  max-width: 1100px;
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.sidebar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.card-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.gio-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gio-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 5px 10px;
  background: var(--secondary);
  border-radius: 5px;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.task-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.task-list.good li::before { background: var(--success); }
.task-list.bad li::before { background: var(--error); }


/* Responsive */
@media (max-width: 900px) {
  .sidebar-section {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: 80px;
    padding: 6px 8px;
  }

  .calendar-cell .solar-day {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 14px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 99;
  }

  .nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-inner,
  .hero-main {
    flex-direction: column;
  }

  .hero-divider {
    width: 100%;
    height: 1px;
    margin: 16px 0;
  }

  .hero-solar-day,
  .hero-lunar-day {
    font-size: 4rem;
  }

  .calendar-toolbar {
    gap: 8px;
  }

  .cal-selectors {
    margin-left: 0;
  }

  .calendar-cell {
    min-height: 68px;
    padding: 5px 6px;
  }

  .calendar-cell .solar-day {
    font-size: 1.125rem;
  }

  .calendar-cell .lunar-day {
    font-size: 0.6875rem;
  }

  .calendar-cell .canchi-day {
    display: none;
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
  }
}

@media (max-width: 480px) {
  .header-logo {
    font-size: 1.125rem;
  }

  .hero {
    padding: 20px 16px;
  }

  .hero-solar-day,
  .hero-lunar-day {
    font-size: 3rem;
  }

  .calendar-wrapper {
    padding: 14px 10px;
  }

  .calendar-cell {
    min-height: 56px;
    padding: 4px 4px;
  }

  .calendar-cell .solar-day {
    font-size: 1rem;
  }

  .calendar-cell .holiday-name {
    display: none;
  }

  .cal-select {
    padding: 5px 8px;
    font-size: 0.8125rem;
  }

  .cal-today-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
  }

  .weekday-label {
    font-size: 0.75rem;
    padding: 8px 2px;
  }

  .sidebar-section {
    padding: 0 16px;
  }
}

/* Utility Pages */
.utility-page {
  padding: 32px 0;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  text-align: center;
}

.page-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.converter-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.converter-tab-row {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--primary);
}

.converter-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--bg);
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.converter-tab.active {
  background: var(--primary);
  color: white;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-row label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 44px;
}

.form-row input {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  width: 80px;
  outline: none;
  transition: border-color var(--transition);
}

.form-row input:focus {
  border-color: var(--primary);
}

.btn-convert {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}

.btn-convert:hover {
  background: var(--primary-dark);
}

.convert-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
  min-height: 50px;
}

.convert-result:empty {
  display: none;
}

/* Tu vi grid */
.tuvi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
}

.tuvi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.tuvi-card:hover {
  transform: translateY(-3px);
}

.tuvi-animal {
  font-size: 2rem;
  margin-bottom: 6px;
}

.tuvi-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.tuvi-fortune {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tuvi-stars {
  color: var(--accent);
  font-size: 0.875rem;
  margin-top: 6px;
}

/* Holiday table */
.holiday-table {
  max-width: 700px;
  margin: 0 auto;
}

.holiday-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.holiday-row:hover {
  transform: translateX(4px);
}

.holiday-date {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 100px;
}

.holiday-name-full {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}

.holiday-days {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Event list */
.event-list {
  max-width: 700px;
  margin: 0 auto;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.event-year {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 50px;
}

.event-desc {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
}

/* Day Detail Modal */
.day-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.day-modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.modal-day-big {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  line-height: 1;
  margin-bottom: 4px;
}

.modal-info {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 14px;
}

.modal-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-section-content {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .tuvi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-row input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tuvi-grid {
    grid-template-columns: 1fr;
  }
}

.calendar-cell.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: rgba(15, 76, 129, 0.1);
}
.calendar-cell.selected .solar-day {
  color: var(--primary);
  font-weight: bold;
}
.dark .calendar-cell.selected {
  background: rgba(255, 255, 255, 0.1);
  outline-color: var(--primary);
}
.dark .calendar-cell.selected .solar-day {
  color: var(--primary);
}
