/* 共通テーブルスタイル */
.app-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
  border: 1px solid #e9ecef; /* outer border */
}
.app-table thead th {
  background: #f8f9fa;
  color: #212529;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 2px solid #c1c7cc; /* thick line between header and body */
}
/* ヘッダーセル全体をクリック可能にする */
.app-table thead th .th-content {
  display: block;
  width: 100%;
  height: 100%;
}
.app-table thead th .th-content a {
  display: block;
  width: 100%;
  height: 100%;
  padding: .6rem .75rem;
  margin: -.6rem -.75rem;
}
.app-table thead th .th-content a:hover {
  background-color: #e9ecef;
}
.app-table tbody tr:nth-child(odd) { background: #fff; }
.app-table tbody tr:nth-child(even) { background: #f9fafb; }
.app-table th, .app-table td {
  padding: .6rem .75rem;
  vertical-align: middle;
  border: 1px solid #e9ecef; /* cell borders */
}

/* 左端カラムを固定するオプション */
.app-table.sticky-left th:first-child,
.app-table.sticky-left td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 6;
  box-shadow: 2px 0 4px rgba(0,0,0,.03);
}

/* 日付列（2列目以降）の幅を固定 */
.app-table.sticky-left th:not(:first-child),
.app-table.sticky-left td:not(:first-child) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
  white-space: nowrap;
}

/* frozen 列: th/td に .frozen を付けると列を固定する（左寄せ） */
.app-table th.frozen,
.app-table td.frozen {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 7;
  border-right: 1px solid #e9ecef;
}

/* compact */
.app-table.compact th, .app-table.compact td { padding: .35rem .5rem; font-size:13px; }

/* スマホ表示対応 - カード形式 */
@media (max-width: 768px) {
  /* テーブルを非表示 */
  .score-table-outer .table-responsive {
    display: none;
  }
  
  /* カードビューを表示 */
  .mobile-card-view {
    display: block !important;
  }
  
  /* デスクトップ検索を非表示 */
  .desktop-search {
    display: none !important;
  }
  
  /* モバイル検索を表示 */
  .mobile-search {
    display: block !important;
  }
  
  /* 検索条件カードをコンパクトに */
  .mobile-search .card {
    margin-bottom: 0.75rem !important;
  }
  
  .mobile-search .card-header {
    padding: 0.5rem 1rem;
  }
  
  .mobile-search .card-header h5 {
    font-size: 0.95rem;
    margin: 0;
  }
  
  .mobile-search .card-body {
    padding: 0.75rem 1rem;
  }
  
  .mobile-search .mb-3 {
    margin-bottom: 0.5rem !important;
  }
  
  .mobile-search .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .mobile-search .form-control {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
  }
  
  .mobile-search .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
}

/* 折りたたみアイコンのアニメーション */
.card-header[data-bs-toggle="collapse"] {
  transition: background-color 0.2s;
}

.card-header[data-bs-toggle="collapse"]:hover {
  background-color: #e9ecef;
}

.collapse-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.card-header[aria-expanded="false"] .collapse-icon {
  transform: rotate(-90deg);
}

.card-header[aria-expanded="true"] .collapse-icon {
  transform: rotate(0deg);
}

/* PC表示 - テーブルを表示 */
@media (min-width: 769px) {
  .mobile-card-view {
    display: none !important;
  }
  
  /* モバイル検索を非表示 */
  .mobile-search {
    display: none !important;
  }
  
  /* デスクトップ検索を表示 */
  .desktop-search {
    display: flex !important;
  }
}

/* モバイル用カードスタイル（日付単位） */
.mobile-card-view {
  display: none;
}

.date-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  text-align: center;
}

.date-card-header h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.store-list {
  padding: 0.5rem;
}

.store-score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.store-score-item:last-child {
  margin-bottom: 0;
}

.store-info {
  flex: 1;
  min-width: 0;
}

.store-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-links {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.store-links .btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  white-space: nowrap;
}

.store-links .btn i {
  font-size: 0.7rem;
}

.store-score {
  flex-shrink: 0;
  margin-left: 0.75rem;
  font-size: 1.1rem;
}

.store-score .badge {
  font-size: 1rem;
  padding: 0.4rem 0.6rem;
}

