/* TDR Hotel Room Ranking Styles
 * @version 1.0.0
 * Generated: 2025-08-21
 * 横スクロール対応・レスポンシブデザイン
 */

.tdr-room-ranking {
  max-width: 100%;
  margin: 0;
}

.tdr-room-ranking table tr td {
  padding: 6px 0px;
  border-left: 0px;
}

.ranking-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ranking-table-container {
  width: 640px;
  /* 最小幅を設定 */
}

.hotel-ranking-table-container {
  width: 640px;
  /* 最小幅を設定 */
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.ranking-table thead {
  background: #2AABDD;
  color: white;
}

.ranking-table th {
  padding: 6px 0px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  border-bottom: 2px solid #5a67d8;
  border-right: none;
}

.ranking-table tbody tr {
  transition: background-color 0.2s ease;
}

.ranking-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* 列幅設定 */
.rank-col {
  width: 32px;
  text-align: center;
  padding: 0 1px;
}

.room-info-col {
  position: relative;
  width: 350px;
}

/* ホテルランキング用列幅設定 */
.hotel-info-col {
  position: relative;
  width: 300px;
}

.rank-count-col {
  width: 240px;
  text-align: center;
}

.price-col {
  width: 150px;
  text-align: center;
}

.time-col {
  width: 52px;
  text-align: center;
}

.rate-col {
  width: 48px;
  text-align: center;
}

.long-rate-col {
  width: 48px;
  text-align: center;
}

/* 順位番号のクールなスタイル（従来） */
.ranking-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  font-weight: bold;
  font-size: 16px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(238, 90, 36, 0.3);
  position: relative;
}

/* FontAwesome ブックマーク順位デザイン */
.ranking-number-fa {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 32px;
  margin-top: -5px;
}

.ranking-number-fa .fa-bookmark {
  width: 30px;
  font-size: 34px;
  color: #ff6b6b;
  text-shadow: 0 2px 4px rgba(238, 90, 36, 0.3);
  text-align: center;
}

.ranking-number-fa .ranking-text {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-weight: bold;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.ranking-number:before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #ff9ff3, #f368e0);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ranking-row:hover .ranking-number:before {
  opacity: 1;
}

/* 1位の特別スタイル */
.ranking-row:first-child .ranking-number {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #333;
  box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
  animation: goldShine 2s ease-in-out infinite alternate;
}

.ranking-row:first-child .ranking-number-fa .fa-bookmark {
  color: #ffd700;
  animation: goldShine 2s ease-in-out infinite alternate;
}

.ranking-row:first-child .ranking-number-fa .ranking-text {
  color: #333;
  text-shadow: 0 1px 2px rgba(255, 215, 0, 0.8);
}

@keyframes goldShine {
  0% {
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
  }

  100% {
    box-shadow: 0 8px 16px rgba(255, 215, 0, 0.6);
  }
}

/* 2位の特別スタイル */
.ranking-row:nth-child(2) .ranking-number {
  background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
  color: #333;
}

.ranking-row:nth-child(2) .ranking-number-fa .fa-bookmark {
  color: #c0c0c0;
}

.ranking-row:nth-child(2) .ranking-number-fa .ranking-text {
  color: #333;
  text-shadow: 0 1px 2px rgba(192, 192, 192, 0.8);
}

/* 3位の特別スタイル */
.ranking-row:nth-child(3) .ranking-number {
  background: linear-gradient(135deg, #cd7f32, #b8860b);
  color: white;
}

.ranking-row:nth-child(3) .ranking-number-fa .fa-bookmark {
  color: #cd7f32;
}

.ranking-row:nth-child(3) .ranking-number-fa .ranking-text {
  color: white;
  text-shadow: 0 1px 2px rgba(205, 127, 50, 0.8);
}

/* 部屋情報エリア */
.tdr-room-ranking .room-main-info {
  display: flex;
  align-items: center;
  margin-top: -16px;
  margin-left: 64px;
  padding: 8px 0;
}

.rank-icon-small {
  width: 52px;
  height: auto;
  flex-shrink: 0;
}

/* 相対配置ランクアイコン */
.rank-icon-relative {
  width: 60px;
  height: auto;
  margin-right: 12px;
  position: absolute;
  top: 2px;
  left: 0px;
  flex-shrink: 0;
}

.tdr-room-ranking .hotel-icon {
  width: 28px;
  height: 28px;
  top: 32px;
  left: 10px;
  position: absolute;
  flex-shrink: 0;
}

.room-details {
  flex: 1;
  min-width: 0;
}

.room-name {
  font-weight: bold;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.room-name a {
  color: #3182ce;
  text-decoration: none;
  font-size: 16px;
}

.room-name a:hover {
  color: #2c5aa0;
}

.room-price {
  text-align: right;
  padding-right: 24px;
  padding-bottom: 2px;
  margin-top: -4px;
  color: #888888;
  font-weight: 600;
}

.room-group {
  color: #666;
  font-size: 12px;
  line-height: 1.3;
}

.tdr-hotel-ranking .room-group {
  text-align: right;
  padding-right: 8px;
}

/* 数値表示 */
.average-time,
.soldout-rate,
.long-soldout-rate {
  font-weight: bold;
  font-size: 14px;
  color: #2d3748;
}

/* ホテル別背景色（calendar_unit_generatorと同じ） */
.tdr-room-ranking table tr.hotel-background-dhm {
  background-color: #fff4d6;
}

.tdr-room-ranking table tr.hotel-background-fsh {
  background-color: #faebfa;
}

.tdr-room-ranking table tr.hotel-background-tdh {
  background-color: #fff0f5;
}

.tdr-room-ranking table tr.hotel-background-tsh {
  background-color: #fffef0;
}

.tdr-room-ranking table tr.hotel-background-dah {
  background-color: #e8eef4;
}

.tdr-room-ranking table tr.hotel-background-dch {
  background-color: #dcf5ed;
}

/* ホテルランキング用スタイル */
.hotel-main-info {
  display: flex;
  align-items: center;
  margin-top: -16px;
  margin-left: 14px;
  padding: 8px 0;
}

.tdr-hotel-ranking table {
  border-collapse: separate;
  border-spacing: 0 4px;
  border-top: none !important;
  border-right: none !important;
  box-shadow: none;
}

.hotel-details {
  flex: 1;
  min-width: 0;
}

.hotel-name {
  font-weight: bold;
  font-size: 16px;
  color: #3182ce;
  min-height: 42px;
}

.rank-counts {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.rank-count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  padding-top: 6px;
}

.rank-sss {
  color: #ff6b6b;
}

.rank-ss {
  color: #ff9500;
}

.rank-s {
  color: #ffd700;
}

.rank-a {
  color: #32cd32;
}

.rank-b {
  color: #1e90ff;
}

.rank-c {
  color: #9370db;
}

/* Metric表示スタイル */
.metric {
  text-align: center;
}

.metric .label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: #ff0000;
  margin-bottom: -8px;
  padding-top: 4px;
}

.metric .value {
  display: block;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

/* ランクアイコングリッド */
.rank-icon-grid {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 0px 0px;
}

.rank-icon-row {
  display: flex;
  gap: 1px;
  justify-content: center;
}

.rank-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  width: 45px;
}

.rank-item .rank-icon-small {
  width: 47px;
  height: auto;
}

.rank-item .rank-count {
  font-size: 18px;
  font-weight: 400;
  color: #333;
}

.tdr-hotel-ranking .hotel-icon {
  width: 32px;
  height: 32px;
  left: -20px;
  top: 34px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .tdr-room-ranking {
    margin: 0;
  }

  .tdr-hotel-ranking {
    margin-left: -8px;
  }

  .ranking-table-container {
    width: 440px;
  }

  .hotel-ranking-table-container {
    min-width: 360px;
    max-width: 93vw;
  }

  /* ホテルランキング用レスポンシブ */
  .hotel-info-col {
    width: 200px;
  }

  .rank-count-col {
    width: 126px;
  }

  .price-col {
    width: 100px;
  }

  .hotel-main-info {
    margin-left: 12px;
    padding-bottom: 1px;
  }

  .hotel-name {
    font-size: 16px;
    min-height: 62px;
  }

  /* モバイル用ランクアイコングリッド（2列×3行に戻す） */
  .rank-icon-grid {
    flex-direction: column;
    gap: 2px;
  }

  .rank-icon-row {
    gap: 1px;
  }

  .rank-item {
    width: 40px;
  }

  .rank-item .rank-icon-small {
    width: 40px;
  }

  .rank-item .rank-count {
    font-size: 16px;
    padding: 4px 0;
  }

  .metric .label {
    font-size: 11px;
    padding-top: 15px;
    margin-bottom: -16px;
  }

  .metric .value {
    font-size: 16px;
  }

  .ranking-table th {
    font-size: 13px;
  }

  .rank-icon-small {
    width: 60px;
  }

  .hotel-info-col .hotel-icon {
    width: 32px;
    height: 32px;
    left: -27px;
    top: 40px;
  }

  .ranking-number {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .rank-icon-relative {
    width: 46px;
    margin-right: 8px;
  }

  .tdr-room-ranking .room-main-info {
    padding: 6px 0 6px 18px;
    margin-left: 30px;
    gap: 1px;
  }

  .room-name {
    min-height: 48px;
    font-size: 14px;
  }

  .room-group {
    margin-left: -28px;
    font-size: 11px;
  }

  .room-info-col {
    width: 200px;
  }

  .average-time,
  .soldout-rate,
  .long-soldout-rate {
    font-size: 13px;
  }
}