/* ==========================================================================
   styles.css - PHẦN MỀM LẬP LÁ SỐ BÁT TỰ - TỨ TRỤ TỬ BÌNH CỔ THƯ
   PHONG THỦY THỨC TÂM - PHONGTHUYTHUCTAM.COM
   ========================================================================== */

:root {
  --bazi-gold: #b45309;
  --bazi-gold-dark: #78350f;
  --bazi-red: #991b1b;
  --bazi-cream: #fffdf9;
  --bazi-border: #fcd34d;
}

/* Lưới Tứ Trụ Bát Tự */
.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background-color: #fef3c7;
  border: 2px solid #b45309;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 10px 25px -5px rgba(180, 83, 9, 0.15);
}

@media (min-width: 768px) {
  .bazi-grid {
    gap: 12px;
    padding: 12px;
  }
}

/* Cột Trụ */
.pillar-card {
  background-color: #fffdf9;
  border: 1px solid #e2d3b3;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.pillar-card:hover {
  background-color: #fffef2;
  border-color: #b45309;
  box-shadow: 0 6px 14px rgba(180, 83, 9, 0.12);
}

.pillar-card.is-day-master {
  background: linear-gradient(180deg, #fffbeb 0%, #fffdf9 100%);
  border: 2px solid #b45309;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.18);
}

/* Nhãn Trụ */
.pillar-header {
  width: 100%;
  text-align: center;
  border-bottom: 1px dashed #e2d3b3;
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.pillar-title {
  font-family: 'Noto Serif', serif;
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pillar-thap-than {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 9999px;
  background-color: #fef3c7;
  color: #92400e;
  margin-top: 3px;
  border: 1px solid #fde68a;
}

.pillar-thap-than.day-master-badge {
  background-color: #991b1b;
  color: #ffffff;
  border-color: #7f1d1d;
  font-weight: 800;
}

/* Chữ Can & Chi to rõ */
.ganzhi-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  width: 100%;
}

.char-badge {
  width: 100%;
  max-width: 90px;
  padding: 6px 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid;
  transition: transform 0.15s ease;
}

.char-badge:hover {
  transform: scale(1.03);
}

.char-main {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-family: 'Noto Serif', serif;
}

.char-han {
  font-size: 11px;
  opacity: 0.75;
  font-family: 'Noto Serif', serif;
}

.char-hanh {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Can Tàng trong Địa Chi */
.tang-can-list {
  width: 100%;
  background-color: #faf8f2;
  border: 1px solid #e8e2d2;
  border-radius: 8px;
  padding: 6px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tang-can-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  background-color: #ffffff;
  border: 1px solid #f1ece1;
}

.tang-can-name {
  font-weight: 700;
}

.tang-can-god {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* Trường Sinh & Nạp Âm */
.pillar-meta {
  width: 100%;
  border-top: 1px dashed #e2d3b3;
  padding-top: 6px;
  margin-top: auto;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.meta-ts {
  color: #92400e;
  font-weight: 700;
}

.meta-napam {
  color: #475569;
  font-weight: 600;
  font-size: 10px;
}

.meta-kong {
  color: #dc2626;
  font-weight: 600;
  font-size: 10px;
}

/* Thần Sát */
.shensha-box {
  width: 100%;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}

.shensha-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid;
  line-height: 1.3;
}

.shensha-tag.cat {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.shensha-tag.hung {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.shensha-tag.trung {
  background-color: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

/* Dãy Đại Vận */
.dayun-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: thin;
  scrollbar-color: #d97706 #fef3c7;
}

.dayun-card {
  min-width: 90px;
  flex: 0 0 auto;
  background-color: #ffffff;
  border: 1px solid #e2d3b3;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dayun-card:hover {
  border-color: #b45309;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(180, 83, 9, 0.15);
}

.dayun-card.is-current {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #b45309;
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.2);
}

/* Bảng Lưu Niên thu gọn/mở rộng */
.liunian-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

@media (min-width: 640px) {
  .liunian-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.liunian-item {
  background-color: #ffffff;
  border: 1px solid #e2d3b3;
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  font-size: 11px;
}

.liunian-item.is-current {
  background-color: #fef2f2;
  border-color: #b91c1c;
  color: #991b1b;
  font-weight: 700;
}

/* Vùng chụp ảnh tải PNG */
.chart-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll-inner {
  min-width: 650px;
}

@media (min-width: 768px) {
  .chart-scroll-inner {
    min-width: 700px;
  }
}

/* In ấn */
@media print {
  .no-print, header, footer, .msg-fab, .zalo-fab {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .chart-scroll-wrapper {
    overflow: visible !important;
  }
  .chart-scroll-inner {
    min-width: 100% !important;
  }
}
