/* Global Styles */
:root {
  --primary-color-dark: #212529;
  --primary-color-text: #ffffff;
  --secondary-color-text: #adb5bd;
  --accent-color-blue: #0077B6;
  --background-light: #f0f2f5;
  --card-background: #ffffff;
  --text-color-dark: #333;
  --highlight-next-bg: #d4edda;
  --highlight-next-text: #155724;
  --highlight-second-next-bg: #E0F7FA;
  --highlight-second-next-text: #007A8D;
  --highlight-past-bg: #ffebee;
  --highlight-past-text: #c62828;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
  background-color: var(--background-light); 
  color: var(--text-color-dark); 
  margin: 0; 
  padding: 0;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
}

.container { 
  width: 100%; 
  max-width: 420px; 
  background-color: var(--card-background); 
  border-radius: 12px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  overflow: hidden; 
  margin: 20px;
}

.header { 
  background-color: var(--primary-color-dark); 
  color: white; 
  padding: 0; 
}

.main-tabs { 
  display: flex; 
}

.tab-btn { 
  flex: 1; 
  padding: 8px 4px; 
  height: 64px; 
  border: none; 
  background-color: transparent; 
  color: var(--secondary-color-text); 
  cursor: pointer; 
  border-bottom: 3px solid transparent; 
  transition: all 0.3s ease; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center; 
  line-height: 1.3; 
  -webkit-tap-highlight-color: transparent; 
}

.tab-icon { 
  font-size: 1.6rem; 
  height: 1.8rem; 
}

.tab-text { 
  font-size: 0.7rem; 
  font-weight: bold; 
  margin-top: 2px; 
  text-align: center; 
}

.tab-btn.active { 
  color: var(--primary-color-text); 
  background-color: rgba(255, 255, 255, 0.1); 
  border-bottom: 3px solid var(--accent-color-blue); 
}

.content-panel { 
  display: none; 
}

.content-panel.active { 
  display: block; 
}

.content { 
  padding: 20px; 
}

#content-spa .content {
  padding: 20px 0;
}

h2 {
  font-size: 1rem; 
  color: var(--accent-color-blue); 
  padding-bottom: 8px; 
  margin: 0 0 15px 0;
  text-align: center; 
  border-bottom: 2px solid #e9ecef;
}

.loading-spinner { 
  border: 4px solid #f3f3f3; 
  border-top: 4px solid var(--accent-color-blue); 
  border-radius: 50%; 
  width: 40px; 
  height: 40px; 
  animation: spin 1s linear infinite; 
  margin: 20px auto; 
}

@keyframes spin { 
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); } 
}

.error-message { 
  text-align: center; 
  padding: 20px; 
  color: #d90429; 
  background-color: #fff5f5; 
  border-radius: 8px;
}

.current-time-container { 
  background-color: var(--primary-color-dark); 
  color: white; 
  padding: 8px 0 12px 0; 
  text-align: center;
  border-radius: 8px;
  margin: 0 20px;
}

.current-time-label { 
  font-size: 0.8rem; 
  color: rgba(255, 255, 255, 0.8); 
  margin-bottom: -5px; 
}

.current-time-value { 
  font-size: 3rem; 
  font-weight: bold; 
  letter-spacing: 2px; 
  line-height: 1.1; 
}

.realtime-board {
  background-color: #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 20px 0 20px;
}

.realtime-board h2 {
  font-size: 1.1rem;
  color: var(--text-color-dark);
  border-left: none;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 10px;
  margin: 0 0 15px 0;
  text-align: center;
}

.departure-box { 
  background-color: var(--card-background); 
  border-radius: 8px; 
  padding: 15px; 
  margin-bottom: 10px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-left: 5px solid var(--accent-color-blue); 
}
.realtime-board .departure-box:last-child {
  margin-bottom: 0;
}

.departure-info .stop-name { 
  font-weight: bold; 
  font-size: 1.3rem; 
}

.departure-time-info { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-end; 
}

.departure-time-info .time { 
  font-size: 1.8rem; 
  font-weight: bold; 
  color: var(--text-color-dark); 
}

.departure-time-info .countdown { 
  font-size: 0.9rem; 
  color: #555; 
}

.second-departure { 
  font-size: 0.9rem; 
  color: #888; 
  margin-top: 4px; 
}

.timetable-section {
  padding: 0 20px;
}

.toggle-group { 
  display: flex; 
  border-radius: 8px; 
  background-color: #e9ecef; 
  padding: 5px; 
  margin-bottom: 20px;
  margin-top: 25px;
}

.toggle-group button { 
  flex: 1; 
  padding: 10px; 
  border: none; 
  background-color: transparent; 
  font-size: 0.9rem; 
  font-weight: bold; 
  color: #555; 
  cursor: pointer; 
  border-radius: 6px; 
  transition: background-color 0.3s, color 0.3s; 
}

.toggle-group button.active { 
  background-color: var(--card-background); 
  color: var(--accent-color-blue); 
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.toggle-group button#holidayBtn.active { 
  background-color: #fff0f3; 
  color: #d90429; 
}

.legend {
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 15px;
}
.legend-item {
    margin: 0 8px;
    display: inline-flex;
    align-items: center;
}
.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 5px;
}
.legend-color.past { background-color: var(--highlight-past-bg); }
.legend-color.next { background-color: var(--highlight-next-bg); }
.legend-color.second-next { background-color: var(--highlight-second-next-bg); }

.timetable table { 
  width: 100%; 
  border-collapse: collapse; 
  table-layout: fixed; 
}

.timetable th, .timetable td { 
  text-align: left; 
  padding: 8px 4px; 
  border-bottom: 1px solid #dee2e6; 
  vertical-align: middle; 
}

.timetable th { 
  background-color: #f8f9fa; 
  font-size: 1rem; 
  text-align: center; 
  width: 40px; 
}

.timetable td { 
  font-size: 0.85rem; 
  font-family: "SF Mono", "Consolas", monospace; 
  display: flex; 
  flex-wrap: nowrap; 
  align-items: center; 
}

.timetable td span { 
  display: inline-block; 
  flex-shrink: 0; 
  width: 28px; 
  line-height: 22px; 
  text-align: center; 
  border-radius: 5px; 
  margin: 1px; 
}

.timetable td span.highlight-past { 
  background-color: var(--highlight-past-bg); 
  color: var(--highlight-past-text); 
  font-weight: bold; 
}

.timetable td span.highlight-next { 
  background-color: var(--highlight-next-bg); 
  color: var(--highlight-next-text); 
  font-weight: bold; 
}

.timetable td span.highlight-second-next { 
  background-color: var(--highlight-second-next-bg); 
  color: var(--highlight-second-next-text); 
}

.spa-header { 
  text-align: center; 
  margin-bottom: 15px; 
  padding: 0 20px;
}

.spa-date { 
  font-size: 1.2rem; 
  color: #555; 
}

.spa-time { 
  font-size: 2.5rem; 
  font-weight: bold; 
  color: var(--accent-color-blue); 
}

.spa-countdown { 
  text-align: center; 
  font-size: 1.2rem; 
  color: var(--text-color-dark); 
  background-color: #f8f9fa; 
  border-radius: 8px; 
  padding: 15px; 
  margin: 0 20px 20px 20px;
}

.spa-countdown-label { 
  font-size: 0.9rem; 
  display: block; 
}

.spa-countdown-time { 
  font-size: 2rem; 
  font-weight: bold; 
  display: block; 
}

.spa-status-grid { 
  display: flex; 
  flex-wrap: wrap; 
  justify-content: space-around; 
  text-align: center; 
  margin-bottom: 20px; 
  padding: 0 20px;
}

.spa-announcement { 
  width: 100%; 
  font-size: 1.1rem; 
  font-weight: bold; 
  color: var(--accent-color-blue); 
  margin-bottom: 15px; 
}

.spa-gender-column { 
  flex: 1; 
  min-width: 120px; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
}

.spa-gender-column h3 { 
  margin: 0 0 10px 0; 
  font-size: 1.2rem; 
}

.spa-icon { 
  height: 4.5rem; 
  width: 100%; 
  margin: 10px 0; 
}

.sauna-type { 
  font-size: 1.5rem; 
  font-weight: bold; 
  margin-top: 5px; 
}

.spa-info { 
  border-top: 1px solid #e9ecef; 
  padding: 15px 20px 0 20px;
  text-align: center; 
}

.spa-info h3 { 
  margin: 0 0 10px 0; 
  font-size: 1rem; 
  color: var(--accent-color-blue); 
}

.spa-info p { 
  margin: 5px 0; 
  font-size: 0.9rem; 
}

.spa-gender-column.male-theme { 
  color: var(--accent-color-blue); 
}

.spa-gender-column.female-theme { 
  color: #d90429; 
}

.facility-card { 
  background-color: #f8f9fa; 
  border-radius: 8px; 
  padding: 15px; 
  margin-bottom: 15px; 
  display: flex; 
  align-items: center; 
  color: var(--text-color-dark); 
  text-decoration: none; 
}

.facility-card.facility-link { 
  cursor: pointer; 
  transition: background-color 0.2s; 
}

.facility-card.facility-link:hover { 
  background-color: #e9ecef; 
}

.facility-icon { 
  font-size: 1rem; 
  font-weight: bold; 
  margin-right: 15px; 
  min-width: 50px; 
  text-align: center; 
}

.facility-icon .material-icons { 
  font-size: 1.8rem; 
  font-weight: normal; 
  vertical-align: middle; 
}

.facility-content { 
  flex: 1; 
}

.facility-title { 
  margin: 0; 
  font-size: 1.1rem; 
  color: var(--accent-color-blue); 
}

.facility-arrow { 
  font-size: 2rem; 
  color: #ced4da; 
  margin-left: 10px; 
}

.small-text { 
  font-size: 0.8rem; 
  color: #6c757d; 
  margin: 4px 0 0 0; 
}

.site-footer { 
  max-width: 420px; 
  width: 100%; 
  box-sizing: border-box; 
  margin: 20px;
  padding: 20px; 
  background-color: var(--card-background); 
  border-radius: 12px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
  font-size: 0.8rem; 
  color: #555; 
  line-height: 1.7; 
}

.site-footer h3 { 
  font-size: 1rem; 
  color: var(--accent-color-blue); 
  text-align: center; 
  margin-top: 0; 
}

/* --- ここから追加 (フッターアクション用) --- */
.footer-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.footer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background-color: var(--accent-color-blue);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background-color 0.2s;
}

.footer-action-btn:hover {
  background-color: #005f8d;
}

.footer-action-btn .material-icons {
  font-size: 1.2rem;
  margin-right: 6px;
}
/* --- ここまで追加 --- */

.facility-category-title { 
  font-size: 1rem; 
  color: var(--accent-color-blue); 
  border-bottom: 2px solid #e9ecef; 
  padding-bottom: 8px; 
  margin-bottom: 15px; 
  margin-top: 25px; 
  text-align: left; 
}

.facility-category-title:first-child { 
  margin-top: 0; 
}

.modal-overlay { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0, 0, 0, 0.6); 
  z-index: 10; 
  display: none; 
}

.modal { 
  position: fixed; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  background-color: white; 
  border-radius: 12px; 
  box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
  z-index: 11; 
  width: 90%; 
  max-width: 420px; 
  max-height: 80vh; 
  display: none; 
  flex-direction: column; 
}

.modal.active, .modal-overlay.active { 
  display: flex; 
}

.modal-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 10px 15px; 
  border-bottom: 1px solid #dee2e6; 
  background: #f8f9fa; 
  border-radius: 12px 12px 0 0;
}

.modal-header h2 { 
  margin: 0; 
  font-size: 1.2rem; 
  color: var(--accent-color-blue); 
}

.modal-close-btn { 
  cursor: pointer; 
  border: none; 
  background: none; 
  font-size: 2rem; 
  font-weight: bold; 
  color: #888; 
}

.modal-body { 
  padding: 15px; 
  overflow-y: auto; 
}

.modal-body p { 
  font-size: 0.9rem; 
  color: #555; 
  margin: 5px 0 15px 0; 
  line-height: 1.6; 
}

.modal-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 0.9rem; 
  margin: 15px 0; 
}

.modal-table th, .modal-table td { 
  border: 1px solid #dee2e6; 
  padding: 8px; 
  text-align: left; 
  vertical-align: top;
}

.modal-table th { 
  background-color: #f8f9fa; 
  width: 35%; 
  font-weight: bold;
}

.portal-link-btn { 
  display: block; 
  width: 100%; 
  padding: 12px; 
  background-color: var(--accent-color-blue); 
  color: white; 
  text-align: center; 
  text-decoration: none; 
  font-weight: bold; 
  border-radius: 8px; 
  margin-top: 15px; 
  box-sizing: border-box; 
}

.qr-code-image {
  width: 80%;
  max-width: 250px;
  height: auto;
  margin: 10px auto;
  display: block;
}

@media (max-width: 420px) {
  body {
    padding: 0;
  }
  .container {
    margin: 0;
    border-radius: 0;
  }
  .site-footer {
    margin: 0;
    border-radius: 0;
  }
  .content {
    padding-left: 0;
    padding-right: 0;
  }
  .realtime-board,
  .timetable-section,
  #content-facilities .content,
  #content-transport .content {
    padding-left: 20px;
    padding-right: 20px;
  }
}
