/*
Theme Name: KBO Analysis Theme
Theme URI: https://your-site.com
Author: KBO Analysis
Author URI: https://your-site.com
Description: KBO 경기분석 전용 워드프레스 테마. 홈 화면에서 날짜별 경기 일정 카드와 상세 분석 페이지를 제공합니다.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kbo-analysis-theme
Tags: sports, baseball, kbo, analysis, dark
*/

/* ============================================================
   CSS 변수 (KBO 다크 테마)
   ============================================================ */
:root {
  --bg-dark:    #0d0d1a;
  --bg-card:    #1a1a2e;
  --bg-card2:   #16213e;
  --accent:     #4fc3f7;
  --accent2:    #f39c12;
  --accent3:    #2ecc71;
  --text-main:  #e0e0e0;
  --text-muted: #888;
  --border:     #2a2a4a;
  --red:        #e74c3c;
  --orange:     #e67e22;
  --blue:       #3498db;
  --green:      #2ecc71;
  --purple:     #9b59b6;
  --header-h:   64px;
}

/* ============================================================
   리셋 & 기본
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

img { max-width: 100%; height: auto; }

/* ============================================================
   레이아웃 컨테이너
   ============================================================ */
.kbo-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   사이트 헤더
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.site-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  line-height: 1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
  background: var(--bg-card);
  color: var(--accent);
}

/* ============================================================
   날짜 탭 바
   ============================================================ */
.date-tab-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.date-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

.date-tab {
  flex: 1;
  max-width: 200px;
  padding: 14px 20px;
  text-align: center;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.date-tab:hover {
  color: var(--text-main);
  background: rgba(79, 195, 247, 0.05);
}

.date-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(79, 195, 247, 0.08);
}

.date-tab .tab-label {
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
  display: block;
  margin-bottom: 2px;
}

.date-tab .tab-date {
  font-size: 15px;
  font-weight: 700;
  color: inherit;
}

/* ============================================================
   경기 카드 그리드
   ============================================================ */
.games-section {
  padding: 28px 0 40px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ============================================================
   경기 카드
   ============================================================ */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(79, 195, 247, 0.15);
  color: var(--text-main);
}

.game-card:hover::before { opacity: 1; }

.game-card.no-data {
  cursor: default;
  opacity: 0.5;
}

.game-card.no-data:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

/* 카드 상단: 구장 + 시간 */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.card-stadium {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

.card-time {
  font-weight: 600;
  color: var(--accent2);
}

/* 카드 중앙: 팀 매치업 */
.card-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-team {
  flex: 1;
  text-align: center;
}

.card-team-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.card-team.away .card-team-name { color: var(--accent); }
.card-team.home .card-team-name { color: var(--accent2); }

.card-team-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-vs {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 카드 하단: 선발 투수 */
.card-starters {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-starter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.card-starter-label {
  color: var(--text-muted);
  font-size: 11px;
}

.card-starter-name {
  font-weight: 600;
  color: var(--text-main);
}

/* 분석 버튼 */
.card-analyze-btn {
  margin-top: 4px;
  padding: 7px 0;
  background: linear-gradient(135deg, rgba(79,195,247,0.15), rgba(243,156,18,0.1));
  border: 1px solid rgba(79,195,247,0.3);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s;
}

.game-card:hover .card-analyze-btn {
  background: linear-gradient(135deg, rgba(79,195,247,0.25), rgba(243,156,18,0.2));
  border-color: var(--accent);
}

/* 분석 없음 배지 */
.card-no-analysis {
  margin-top: 4px;
  padding: 7px 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   날짜 패널 (어제/오늘/내일)
   ============================================================ */
.date-panel {
  display: none;
}

.date-panel.active {
  display: block;
}

/* ============================================================
   빈 상태
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 15px;
}

/* ============================================================
   경기 분석 상세 페이지 (iframe 임베드)
   ============================================================ */
.analysis-page-wrap {
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.analysis-back-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.analysis-back-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-back:hover {
  background: rgba(79,195,247,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.analysis-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.analysis-iframe-wrap {
  flex: 1;
  width: 100%;
}

.analysis-iframe-wrap iframe {
  width: 100%;
  border: none;
  display: block;
  min-height: calc(100vh - var(--header-h) - 60px);
}

/* ============================================================
   사이트 푸터
   ============================================================ */
#site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-note {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .date-tab .tab-date { font-size: 13px; }

  .card-team-name { font-size: 15px; }

  .analysis-title { font-size: 13px; }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: 1fr;
  }

  .header-nav { display: none; }
}
