/* ═══════════════════════════════════════════════════
   Soccer Coach Board — App Styles
═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Boards modal tabs — active tab needs dark text on white background ── */
#boardsTabs .nav-link.active {
  color: #212529 !important;
}

/* ── Welcome modal step numbers ─────────────────── */
.welcome-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #238636;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ── Help button (now in navbar) ─────────────────── */

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: #0d1117;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e6edf3;
}

#app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ── Navbar ─────────────────────────────────────── */
#top-nav {
  min-height: 48px;
}

/* Dropdown control panel — floats over the canvas, doesn't push it down */
#navbarControls {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 1040;
  background: #1a1f2e;
  border-bottom: 1px solid #30363d;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  padding: 0 1rem;
}

#navbarControls .d-flex {
  padding-bottom: 0.75rem;
}

/* ── Main area ───────────────────────────────────── */
#main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Left toolbar ────────────────────────────────── */
#left-toolbar {
  width: 52px;
  flex-shrink: 0;
  background: #161b22;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
}

.toolbar-section-label {
  font-size: 0.55rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.toolbar-divider {
  width: 36px;
  height: 1px;
  background: #30363d;
  margin: 4px 0;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #8b949e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.tool-btn:hover {
  background: #21262d;
  color: #e6edf3;
  border-color: #30363d;
}

.tool-btn.active {
  background: #1f6feb;
  color: #fff;
  border-color: #388bfd;
}

.tool-btn.team-add-btn {
  color: #3fb950;
}
.tool-btn.team-add-btn:hover {
  color: #fff;
  background: #238636;
  border-color: #2ea043;
}

/* ── Canvas container ────────────────────────────── */
#canvas-container {
  flex: 1;
  overflow: hidden;
  background: #0a0f14;
  position: relative;
  cursor: default;
}

#konva-container {
  width: 100%;
  height: 100%;
}

/* Cursor states */
#canvas-container.tool-select  { cursor: default; }
#canvas-container.tool-arrow   { cursor: crosshair; }
#canvas-container.tool-delete  { cursor: not-allowed; }
#canvas-container.drawing-arrow { cursor: crosshair; }

/* ── Status bar ──────────────────────────────────── */
#status-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 17, 23, 0.85);
  color: #8b949e;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #30363d;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s;
}

/* ── Steps panel ─────────────────────────────────── */
#steps-panel {
  height: 52px;
  flex-shrink: 0;
  background: #161b22;
  border-top: 1px solid #30363d;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  overflow-x: auto;
}

/* Normalize all btn-sm buttons in the steps panel to the same height */
#steps-panel .btn-sm {
  height: 28px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.steps-label {
  font-size: 0.75rem;
  color: #8b949e;
  white-space: nowrap;
  flex-shrink: 0;
}

#steps-list {
  display: flex;
  gap: 4px;
  align-items: center;
}

.step-btn {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.step-btn:hover {
  background: #30363d;
  color: #e6edf3;
}

.step-btn.active {
  background: #1f6feb;
  border-color: #388bfd;
  color: #fff;
  font-weight: 600;
}

.steps-sep {
  width: 1px;
  height: 28px;
  background: #30363d;
  flex-shrink: 0;
  margin: 0 2px;
}

.sim-speed-select {
  width: 70px;
  font-size: 0.72rem;
  background: #21262d;
  color: #e6edf3;
  border-color: #30363d;
  height: 28px;
  padding: 0 4px;
}

/* ── Context menu ────────────────────────────────── */
.ctx-menu {
  position: fixed;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 4px 0;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 9999;
  font-size: 0.82rem;
}

.ctx-item {
  padding: 6px 14px;
  cursor: pointer;
  color: #e6edf3;
  display: flex;
  align-items: center;
  transition: background 0.1s;
}

.ctx-item:hover { background: #21262d; }
.ctx-item.danger { color: #f85149; }
.ctx-item.danger:hover { background: #2d1b1b; }

.ctx-divider {
  height: 1px;
  background: #30363d;
  margin: 4px 0;
}

/* ── Modals ──────────────────────────────────────── */
.modal-content {
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

/* ── Konva canvas cursor overrides ──────────────── */
.konvajs-content { outline: none; }
.konvajs-content canvas { outline: none; }

/* ── Selection ring pulse ────────────────────────── */
@keyframes selectionPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Player name inputs in modal ─────────────────── */
.player-names-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.player-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: bold;
  flex-shrink: 0;
}

.player-role-badge {
  font-size: 0.68rem;
  color: #8b949e;
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.player-name-input {
  font-size: 0.78rem !important;
  padding: 2px 6px !important;
  height: 26px !important;
}

#export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: #fff;
  font-size: 1.2rem;
  gap: 12px;
}

/* ── Game AI (Experimental) ──────────────────────────── */

/* "EXP" badge next to the AI label */
.ai-exp-badge {
  display: inline-block;
  font-size: 0.42rem;
  font-weight: 700;
  background: #6e40c9;
  color: #fff;
  border-radius: 3px;
  padding: 1px 3px;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 2px;
}

/* AI toggle button — purple accent */
.tool-btn.ai-toggle-btn {
  color: #a371f7;
  font-size: 1.1rem;
}
.tool-btn.ai-toggle-btn:hover {
  background: #2d1f5e;
  color: #d2a8ff;
  border-color: #6e40c9;
}
.tool-btn.ai-toggle-btn.active {
  background: #6e40c9;
  color: #fff;
  border-color: #a371f7;
  box-shadow: 0 0 0 2px rgba(163, 113, 247, 0.35);
}

/* "AI Response" button in the steps panel */
.btn-ai-response {
  background: #2d1f5e;
  color: #d2a8ff;
  border: 1px solid #6e40c9;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-ai-response:hover {
  background: #6e40c9;
  color: #fff;
  border-color: #a371f7;
}
.btn-ai-response:active {
  background: #4c2fa0;
}

/* Model selector dropdown */
.ai-model-select {
  background: #1a1226;
  color: #d2a8ff;
  border: 1px solid #6e40c9;
  border-radius: 4px;
  font-size: 0.72rem;
  max-width: 120px;
  padding: 2px 4px;
  cursor: pointer;
}
.ai-model-select:focus {
  outline: none;
  border-color: #a371f7;
  box-shadow: 0 0 0 2px rgba(163,113,247,0.25);
}
