/* =========================================
   타이어 & 피트스톱 가이드 전용 스타일 (tire.css)
   guide/tire.html 전용 — guide.css 수정 없음
   ========================================= */

/* =========================================
   섹션 공통
   ========================================= */

.tire-section {
  margin-bottom: 3rem;
}

.tire-section-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #f5f5f5;
  margin-bottom: 0.5rem;
}

.tire-section-subtitle {
  color: #888;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* =========================================
   섹션 1: 컴파운드 스펙트럼
   ========================================= */

.compound-spectrum {
  display: flex;
  gap: 0.75rem;
}

.compound-card {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 0;
}

.compound-card:hover {
  border-color: #444;
}

.compound-card.active {
  border-color: #dc2626;
}

.compound-card-name {
  font-size: 1rem;
  font-weight: bold;
  color: #f5f5f5;
  margin-bottom: 0.15rem;
}

.compound-card-label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.75rem;
}

/* 프로그레스 바 */
.compound-bar-group {
  margin-bottom: 0.5rem;
}

.compound-bar-label {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.compound-bar {
  width: 100%;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
}

.compound-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.compound-bar-fill.grip {
  background: #EF4444;
}

.compound-bar-fill.durability {
  background: #3B82F6;
}

/* 아코디언 상세 영역 */
.compound-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.compound-card.active .compound-detail {
  max-height: 300px;
  transition: max-height 0.3s ease-in;
}

.compound-detail-content {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #2a2a2a;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.compound-card.active .compound-detail-content {
  opacity: 1;
}

.compound-detail-desc {
  color: #ddd;
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.compound-detail-meta {
  color: #888;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* 카드 펼침 표시 화살표 */
.compound-card-chevron {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  margin-top: 0.5rem;
  transition: transform 0.3s ease;
}

.compound-card.active .compound-card-chevron {
  transform: rotate(180deg);
}

/* 면책 조항 */
.tire-disclaimer {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
  line-height: 1.5;
}

/* 2026 규정 변경 안내 문구 */
.tire-regulation-notice {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.6;
  padding: 0.6rem 0.875rem;
  background: #1a1f2e;
  border-left: 3px solid #6366f1;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* 우천용 타이어 행 */
.wet-tire-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* 우천용 타이어 카드 */
.wet-tire-card {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 0;
}

.wet-tire-card:hover {
  border-color: #444;
}

.wet-tire-card.active {
  border-color: #6366f1;
}

.wet-tire-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
}

.wet-tire-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.wet-tire-name {
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1.2;
}

.wet-tire-type {
  font-size: 0.7rem;
  color: #888;
}

.wet-tire-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* 우천용 카드 아코디언 — 드라이 카드와 동일한 패턴 재사용 */
.wet-tire-card .compound-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.wet-tire-card.active .compound-detail {
  max-height: 300px;
  transition: max-height 0.3s ease-in;
}

.wet-tire-card .compound-detail-content {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #2a2a2a;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.wet-tire-card.active .compound-detail-content {
  opacity: 1;
}

.wet-tire-card .compound-card-chevron {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  margin-top: 0.5rem;
  transition: transform 0.3s ease;
}

.wet-tire-card.active .compound-card-chevron {
  transform: rotate(180deg);
}

/* =========================================
   섹션 2: 레이스 타이어 선택
   ========================================= */

.race-selection {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

/* 그랑프리 선택 콤보박스 */
.race-selection-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.race-select-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f5f5f5;
  white-space: nowrap;
}

.race-select {
  flex: 1;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 0.375rem;
  color: #f5f5f5;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
}

.race-select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

/* C1~C6 스펙트럼 칩 */
.race-compound-spectrum {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  justify-content: center;
}

.race-spectrum-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 0.375rem;
  min-width: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.race-spectrum-chip.selected {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
  background: #1f1f1f;
}

.race-spectrum-chip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5f5f5;
}

.race-spectrum-chip-role {
  font-size: 0.7rem;
  font-weight: 500;
}

.race-selection-gp {
  font-size: 1rem;
  font-weight: bold;
  color: #f5f5f5;
  margin-bottom: 1.25rem;
  text-align: center;
}

.race-mapping {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.race-mapping-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.race-mapping-compound {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f5f5f5;
  text-align: center;
}

.race-mapping-compound.highlighted {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.race-mapping-arrow {
  color: #888;
  font-size: 1.25rem;
}

.race-mapping-tire {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #3a3a3a;
  background: #2a2a2a;
}

/* 타이어 아이콘 */
.tire-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.race-mapping-tire-role {
  font-size: 0.85rem;
  font-weight: 500;
  color: #ddd;
}

.race-mapping-connector {
  display: flex;
  align-items: center;
  color: #555;
  font-size: 1.25rem;
  padding: 0 0.25rem;
}

/* =========================================
   섹션 3: 피트스톱 전략
   ========================================= */

/* 전략 요약 텍스트 */
.strategy-summary {
  color: #aaa;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #1a1a1a;
  border-left: 3px solid #dc2626;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* 전략 토글 — format-toggle 패턴 재활용 */
.strategy-toggle {
  display: inline-flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: #1a1a1a;
  border-radius: 9999px;
  padding: 0.25rem;
  border: 1px solid #2a2a2a;
  /* guide.css .format-toggle 패턴과 동일한 중앙 정렬 */
  margin-left: 50%;
  transform: translateX(-50%);
}

.strategy-toggle-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
}

.strategy-toggle-btn:hover {
  color: #ccc;
}

.strategy-toggle-btn.active {
  background: #dc2626;
  color: #fff;
}

/* 활성 탭의 아이콘(▼▲)이 빨간 배경에서 사라지지 않도록 흰색 강제 */
.strategy-toggle-btn.active * {
  color: #FFFFFF;
  fill: #FFFFFF;
}

/* 탭 아이콘 기본 색상 (비활성: 빨강, 활성: 흰색) */
.strategy-tab-icon {
  color: #EF4444;
  transition: color 0.2s;
}

.strategy-toggle-btn.active .strategy-tab-icon {
  color: #FFFFFF;
}

/* 전략 타임라인 */
.strategy-timeline-wrapper {
  position: relative;
}

.strategy-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.strategy-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.5rem;
  min-width: 0;
}

.strategy-step-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.strategy-step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 0.35rem;
}

.strategy-step-desc {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
}

.strategy-step-arrow {
  display: flex;
  align-items: center;
  color: #555;
  font-size: 1.25rem;
  padding-top: 1rem;
  flex-shrink: 0;
}

/* 페이드 애니메이션 */
.strategy-fade-out {
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.strategy-fade-in {
  opacity: 1;
  transition: opacity 300ms ease-in;
}

/* =========================================
   반응형 레이아웃 (768px 미만)
   ========================================= */

@media (max-width: 768px) {
  /* 컴파운드 카드 세로 배치 */
  .compound-spectrum {
    flex-direction: column;
  }

  .compound-card {
    min-height: 44px;
  }

  /* 레이스 매핑 세로 배치 */
  .race-mapping {
    flex-direction: column;
    gap: 1rem;
  }

  .race-mapping-connector {
    transform: rotate(90deg);
  }

  /* 콤보박스 풀 너비 */
  .race-selection-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .race-select {
    max-width: 100%;
  }

  /* 스펙트럼 칩 줄바꿈 허용 */
  .race-compound-spectrum {
    flex-wrap: wrap;
  }

  /* 우천용 타이어 카드 세로 배치 */
  .wet-tire-row {
    flex-direction: column;
  }

  /* 전략 타임라인 세로 배치 */
  .strategy-timeline {
    flex-direction: column;
    align-items: stretch;
  }

  .strategy-step {
    flex-direction: row;
    text-align: left;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .strategy-step-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .strategy-step-text {
    flex: 1;
  }

  .strategy-step-arrow {
    transform: rotate(90deg);
    padding-top: 0;
    justify-content: center;
  }

  /* 터치 영역 확보 */
  .compound-card {
    padding: 1rem;
  }

  .strategy-toggle-btn {
    padding: 0.75rem 1.25rem;
    min-height: 44px;
    min-width: 44px;
  }
}
