/* ============================================
   DPA Real-time Status Page
   ============================================ */

.dpa-header {
  text-align: center;
  padding: 48px 0 16px;
}
.dpa-header .page-title {
  font-size: 1.4rem;
}
.dpa-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}
.dpa-update {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: "Inter", sans-serif;
}
.dpa-update .live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4caf50;
  margin-right: 4px;
  animation: dpaPulse 2s infinite;
}
@keyframes dpaPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Park Switch */
.dpa-park-switch {
  display: flex;
  gap: 0;
  margin: 24px auto 20px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  width: fit-content;
  max-width: 100%;
}
.dpa-park-btn {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.dpa-park-btn:hover { color: #334155; }
.dpa-park-btn.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.dpa-park-btn[data-park="tdl"].active { color: #d81b72; }
.dpa-park-btn[data-park="tds"].active { color: #2563a8; }

/* Summary bar */
.dpa-summary {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dpa-summary-item {
  text-align: center;
}
.dpa-summary-num {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.dpa-summary-num--available { color: #27ae60; }
.dpa-summary-num--sold { color: #e74c3c; }
.dpa-summary-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* DPA List (compact rows like priority pass) */
.dpa-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 32px;
}
.dpa-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  gap: 12px;
}
.dpa-row-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dpa-dot--available { background: #27ae60; }
.dpa-dot--sold { background: #e74c3c; }
.dpa-dot--closed { background: #94a3b8; }
.dpa-row-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dpa-row-name a { color: inherit; }
.dpa-row-name a:hover { color: var(--accent); }
.dpa-row-price {
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  flex-shrink: 0;
}
.dpa-row-soldtime {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c0392b;
  flex-shrink: 0;
}
.dpa-row-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.dpa-badge--available {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
}
.dpa-badge--sold {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}
.dpa-badge--closed {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
}
.dpa-row-wait {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
  flex-shrink: 0;
}
.dpa-row-wait small {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Standby Pass Section */
.dpa-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.dpa-section-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -8px 0 16px;
}

/* Standby pass list (compact) */
.sp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 32px;
}
.sp-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  gap: 12px;
}
.sp-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sp-status-dot--available { background: #27ae60; }
.sp-status-dot--sold { background: #e74c3c; }
.sp-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.sp-badge--available {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
}
.sp-badge--sold {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}
.sp-wait {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
  flex-shrink: 0;
}
.sp-wait small {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Guide Section */
.dpa-guide {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
.dpa-guide-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}
.dpa-guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.dpa-tip-card {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.dpa-tip-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.dpa-tip-text {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
}
.dpa-more-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}
.dpa-more-link:hover {
  text-decoration: underline;
}

/* Loading & Error */
.dpa-loading {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.dpa-loading::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dash-spin 0.7s linear infinite;
}
@keyframes dash-spin {
  to { transform: rotate(360deg); }
}

/* Pre-open message */
.dpa-preopen {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 24px;
}
.dpa-preopen-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.dpa-preopen-text {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* Note */
.dpa-note {
  padding: 24px 0 40px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}
.dpa-note p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Soldout History Table ===== */
.dpa-soldout-section {
  margin-top: 40px;
}
.dpa-soldout-wrap {
  margin-top: 16px;
}
.soldout-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.soldout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 520px;
}
.soldout-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.soldout-table th {
  background: var(--surface);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 10px 6px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  line-height: 1.4;
  vertical-align: bottom;
}
.soldout-th-date {
  min-width: 72px;
  text-align: left !important;
  padding-left: 12px !important;
}
.soldout-th-crowd {
  min-width: 48px;
}
.soldout-th-attr {
  min-width: 64px;
  white-space: pre-line !important;
}
.soldout-table td {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  font-family: "Inter", sans-serif;
}
.soldout-date {
  text-align: left !important;
  padding-left: 12px !important;
  font-size: 0.78rem;
  color: var(--text-sub);
  white-space: nowrap;
}
.soldout-date-today {
  text-align: left !important;
  padding-left: 12px !important;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* Today row highlight */
.soldout-row-today {
  background: rgba(37, 99, 168, 0.06);
}
.soldout-row-today td {
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
}

/* Crowd badge */
.soldout-crowd {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: #94a3b8;
}
/* パーク別色はJS inline styleで適用（CROWD_COLORS_TDL/TDS） */

/* Soldout time cells */
.soldout-cell {
  font-size: 0.82rem;
  font-weight: 500;
}
.soldout-cell--sold {
  color: #c0392b;
  font-weight: 600;
}
.soldout-cell--available {
  color: #27ae60;
  font-weight: 700;
  font-size: 0.72rem;
}
.soldout-cell--na {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Refurb cell */
.soldout-cell--refurb {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: inherit;
}

/* ===== Prediction Table ===== */
.dpa-predict-section {
  margin-top: 32px;
}
.dpa-predict-wrap {
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.predict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 480px;
}
.predict-table th {
  background: var(--surface);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 10px 6px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  line-height: 1.4;
  vertical-align: bottom;
}
.predict-th-crowd {
  min-width: 100px;
  text-align: left !important;
  padding-left: 12px !important;
}
.predict-th-attr {
  min-width: 64px;
  white-space: pre-line !important;
}
.predict-table td {
  padding: 12px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.predict-crowd-cell {
  text-align: left !important;
  padding-left: 12px !important;
}
.predict-crowd-label {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.predict-crowd-label.predict-low {
  color: #27ae60;
  background: rgba(39,174,96,0.1);
}
.predict-crowd-label.predict-mid {
  color: #e67e22;
  background: rgba(230,126,34,0.1);
}
.predict-crowd-label.predict-high {
  color: #e74c3c;
  background: rgba(231,76,60,0.1);
}
.predict-crowd-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.predict-cell {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}
.predict-cell--low { color: #27ae60; }
.predict-cell--mid { color: #e67e22; }
.predict-cell--high { color: #c0392b; }
.predict-cell--nodata {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 400;
  font-family: inherit;
}
.predict-cell--nosold {
  color: #27ae60;
  font-size: 0.72rem;
  font-weight: 400;
  font-family: inherit;
}

/* 日付別DPA売切予測 */
.dpa-date-predict-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.dpa-date-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--card-bg);
  color: var(--text);
}
.dpa-date-predict-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.dpa-date-predict-card h3 {
  font-size: 0.92rem;
  margin: 0 0 12px;
  font-weight: 600;
}
.dpa-predict-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.dpa-predict-row:last-child { border-bottom: none; }
.dpa-predict-row-name { flex: 1; }
.dpa-predict-row-time {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}
.dpa-predict-row-time--sold { color: #c0392b; }
.dpa-predict-row-time--safe { color: #27ae60; }
.dpa-predict-warn {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(231,76,60,0.06);
  border-radius: 8px;
  font-size: 0.78rem;
  color: #c0392b;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .dpa-cards {
    grid-template-columns: 1fr;
  }
  .dpa-guide-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .dpa-header { padding: 32px 0 12px; }
  .dpa-header .page-title { font-size: 1.15rem; }
  .dpa-park-btn { padding: 8px 24px; font-size: 0.82rem; }
  .sp-name { font-size: 0.75rem; }
}
