/**
 * static/css/modules/smart_review.css?v=2
 * Styling for Smart Review (AI Tactical Coach).
 */

#page-smart-review {
  display: none;
  flex-direction: column !important;
  background: var(--bg, #0b1120);
  color: var(--text-main, #f8fafc);
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

#page-smart-review.active {
  display: flex !important;
  flex-direction: column !important;
}

#page-smart-review .topbar {
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  background: var(--bg2, #0f172a);
  border-bottom: 1px solid var(--border, #334155);
}

#page-smart-review .gr-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  max-width: 1750px;
  width: 100%;
  height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 12px 24px;
  box-sizing: border-box;
  overflow: hidden;
  align-items: stretch;
  flex: 1;
}

/* Left Column: Summary & Breakdown */
#page-smart-review .gr-left-pane {
  width: 300px;
  min-width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 100%;
}

/* Center Column: Board, Players & Controls */
#page-smart-review .gr-board-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

#page-smart-review .gr-board-wrap {
  width: 100%;
  max-width: min(calc(100vh - 140px), 765px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#page-smart-review .gr-board-center {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  align-items: stretch;
}

#page-smart-review #sr-board {
  width: min(calc(100dvh - 190px), calc(100vh - 190px), 720px, calc(100% - 36px)) !important;
  height: auto !important;
  max-width: min(calc(100dvh - 190px), calc(100vh - 190px), 720px, calc(100% - 36px)) !important;
  aspect-ratio: 1;
}

#page-smart-review #sr-eval-bar {
  width: 26px;
  height: auto !important;
  align-self: stretch;
}

/* Right Column: Tactical Coach & Moves List */
#page-smart-review .gr-report-pane {
  width: 360px;
  min-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Section Tabs: Coach vs Deep Analysis */
.sr-report-tabs {
  display: flex;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  flex-shrink: 0;
}

.sr-report-tab-btn {
  flex: 1;
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.sr-report-tab-btn:hover {
  color: #f8fafc;
  background: rgba(51, 65, 85, 0.4);
}

.sr-report-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

#sr-tab-analysis-btn.active {
  background: #9d4edd !important;
  box-shadow: 0 2px 6px rgba(157, 78, 221, 0.4) !important;
}

/* Tab Views */
.sr-tab-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Coach Card - fixed stable height so lower moves card never jumps */
#page-smart-review #sr-coach-card {
  height: 245px !important;
  min-height: 245px !important;
  max-height: 245px !important;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

#page-smart-review #sr-coach-card::-webkit-scrollbar {
  width: 5px;
}
#page-smart-review #sr-coach-card::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

/* Analysis Move List Card with purple active pill */
#page-smart-review #sr-analysis-moves-card {
  flex: 1;
  min-height: 0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  box-sizing: border-box;
}

#page-smart-review #sr-analysis-moves-card::-webkit-scrollbar {
  width: 6px;
}
#page-smart-review #sr-analysis-moves-card::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

#page-smart-review #sr-analysis-moves-card .gv-move-row {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  min-height: 28px;
}

#page-smart-review #sr-analysis-moves-card .gv-move-num {
  width: 36px;
  color: #64748b;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  flex-shrink: 0;
}

#page-smart-review #sr-analysis-moves-card .gv-move {
  flex: 1;
  padding: 3px 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.12s ease;
  user-select: none;
}

#page-smart-review #sr-analysis-moves-card .gv-move:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#page-smart-review #sr-analysis-moves-card .gv-move.active {
  background: #9d4edd !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(157, 78, 221, 0.45) !important;
}

#page-smart-review .gv-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.12s ease;
}

#page-smart-review .gv-mode-btn:hover {
  color: #f8fafc;
}

#page-smart-review .gv-mode-btn.active {
  background: #334155;
  color: #38bdf8;
  font-weight: 700;
}

/* Stable Moves List Card - fills remaining space cleanly */
#page-smart-review #sr-moves-card {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#page-smart-review #sr-moves-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#page-smart-review #sr-moves-list::-webkit-scrollbar {
  width: 6px;
}
#page-smart-review #sr-moves-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

/* Controls */
#page-smart-review .gr-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

#page-smart-review .gr-controls .btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

#page-smart-review .gr-controls .btn:hover {
  background: #334155;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Accuracy Hero Card */
.sr-acc-box {
  background: #0f172a;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sr-acc-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Badges */
.sr-badge-brilliant {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.sr-badge-great {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.sr-badge-best {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.sr-badge-blunder {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.sr-badge-miss {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.4);
}

/* Coach Card */
#sr-coach-card {
  position: relative;
  overflow: hidden;
}

#sr-coach-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
}

/* Move rows */
.sr-move-item:hover {
  background: #1e293b !important;
  border-color: #475569 !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  #page-smart-review .gr-container {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  #page-smart-review .gr-left-pane,
  #page-smart-review .gr-board-pane,
  #page-smart-review .gr-report-pane {
    width: 100%;
    min-width: unset;
  }
}
