@import "../css/common.css";

body {
  background: linear-gradient(180deg, #f7fbff 0%, #eef7ff 100%);
  color: #22364a;
}

.buhappyou-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.hero-card,
.content-panel,
.info-card,
.spotlight-card {
  box-shadow: 0 10px 30px rgba(33, 94, 140, 0.1);
  border-radius: 20px;
  background: #ffffff;
}

.hero-card {
  padding: 28px 24px;
  margin-bottom: 24px;
  border: 1px solid #dcecf8;
}

.maintext {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  text-align: center;
  margin: 0 0 10px;
  color: #1f4d73;
}

.subtext {
  text-align: center;
  margin: 0;
  color: #5b7186;
  line-height: 1.7;
}

.section-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-nav button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #35628b;
  background: #eaf4ff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-nav button.active,
.section-nav button:hover {
  background: #4cafef;
  color: #fff;
}

.content-panel {
  display: none;
  padding: 24px;
}

.content-panel.active {
  display: block;
}

.panel-heading h2 {
  margin: 0 0 6px;
  color: #1f4d73;
}

.panel-heading p {
  margin: 0 0 18px;
  color: #67809a;
}

.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters label,
.heatmap-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #35536f;
}

select {
  border: 1px solid #cfe3f1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fcff;
}

.spotlight-card {
  padding: 18px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #eaf7ff 0%, #fdfefe 100%);
  border-left: 6px solid #4cafef;
}

.spotlight-title {
  font-weight: 700;
  color: #1f6ea4;
  margin-bottom: 8px;
}

.spotlight-card h3 {
  margin: 0 0 8px;
  color: #1f4d73;
}

.spotlight-card p,
.spotlight-card span {
  margin: 0;
  color: #56708b;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 15px;
}

.schedule-table th,
.schedule-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7f2fb;
  text-align: left;
  vertical-align: top;
}

.schedule-table th {
  background: #f1f8ff;
  color: #2e5979;
}

.schedule-description {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #6d8092;
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e8eef5;
  color: #51657a;
}

.status-badge.is-active {
  background: #ffefcf;
  color: #9a5a00;
}

.status-badge.is-soon {
  background: #e6f5e0;
  color: #3a7d2e;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2edf7;
}

.info-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  background: #f4faff;
  padding: 8px;
}

.info-card h4 {
  margin: 0 0 6px;
  color: #1f4d73;
}

.info-card p {
  margin: 0 0 8px;
  color: #5f7388;
  line-height: 1.6;
}

.info-card a {
  color: #4cafef;
  font-weight: 700;
  text-decoration: none;
}

.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 5000;
}

.detail-modal.open {
  display: flex;
}

.detail-modal-content {
  width: min(720px, 100%);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.detail-modal-body {
  padding: 0 22px 24px;
}

.detail-image-container {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.detail-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-image-placeholder {
  color: #7b8ea4;
  font-size: 0.95rem;
  padding: 26px;
}

.detail-description {
  color: #32475b;
  line-height: 1.8;
  white-space: pre-line;
  font-size: 1rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.heatmap-cell {
  padding: 18px;
  border-radius: 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  justify-content: center;
}

.heatmap-cell.status-relaxed {
  background: #73c97b;
}

.heatmap-cell.status-normal {
  background: #67b4e6;
}

.heatmap-cell.status-busy {
  background: #f2b754;
}

.heatmap-cell.status-crowded {
  background: #e56b5d;
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  color: #51657a;
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.legend-swatch.status-relaxed { background: #73c97b; }
.legend-swatch.status-normal { background: #67b4e6; }
.legend-swatch.status-busy { background: #f2b754; }
.legend-swatch.status-crowded { background: #e56b5d; }

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .buhappyou-page {
    padding: 16px 12px 40px;
  }

  .content-panel,
  .hero-card {
    padding: 18px;
  }

  .section-nav {
    gap: 8px;
  }

  .section-nav button {
    font-size: 0.9rem;
    padding: 9px 14px;
  }

  .filters {
    gap: 10px;
  }

  .filters label {
    width: 100%;
    font-size: 0.9rem;
  }

  .filters select {
    width: 100%;
    font-size: 0.95rem;
  }

  .spotlight-card {
    padding: 14px;
  }

  .spotlight-card h3 {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .spotlight-card span {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .heatmap-grid,
  .heatmap-controls {
    grid-template-columns: 1fr;
  }

  .schedule-table {
    border: none;
    border-radius: 0;
  }

  .schedule-table thead {
    display: none;
  }

  .schedule-table tbody,
  .schedule-table tr,
  .schedule-table td {
    display: block;
    width: 100%;
  }

  .schedule-table tr {
    background: #fff;
    border: 1px solid #dcecf8;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(33, 94, 140, 0.08);
    overflow: hidden;
  }

  .schedule-table td {
    border-bottom: 1px solid #edf4fb;
    padding: 8px 12px;
    font-size: 0.88rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    text-align: right;
  }

  .schedule-table td:last-child {
    border-bottom: none;
  }

  .schedule-table td::before {
    color: #5d7993;
    font-weight: 700;
    flex: 0 0 auto;
  }

  .schedule-table td:nth-child(1) {
    background: #f1f8ff;
    color: #1f4d73;
    font-weight: 800;
    font-size: 1rem;
  }

  .schedule-table td:nth-child(1)::before { content: "時間"; }
  .schedule-table td:nth-child(2)::before { content: "場所"; }
  .schedule-table td:nth-child(3)::before { content: "内容"; }
  .schedule-table td:nth-child(4)::before { content: "種別"; }
  .schedule-table td:nth-child(5)::before { content: "状態"; }

  .status-badge {
    font-size: 0.78rem;
    padding: 4px 9px;
  }
}

