/* Mobile web: hide scrollbars (touch devices) */
@media (hover: none) {
  * { scrollbar-width: none !important; }
  *::-webkit-scrollbar { display: none !important; }
}

/* Desktop web: subtle, thin scrollbars always visible
   * selector catches everything: #root descendants, portals, overlays
   !important overrides React Native Web's atomic CSS
   (ScrollViewBase applies scrollbarWidth:'none' → .r-xyz::-webkit-scrollbar{display:none}) */
@media (hover: hover) {
  * {
    scrollbar-width: thin !important;
    scrollbar-color: hsla(220, 15%, 55%, 0.12) transparent !important;
  }
  *::-webkit-scrollbar {
    display: block !important;
    width: 3px !important;
    height: 3px !important;
  }
  *::-webkit-scrollbar-track {
    background: transparent !important;
  }
  *::-webkit-scrollbar-thumb {
    background: hsla(220, 15%, 55%, 0.12) !important;
    border-radius: 3px !important;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: hsla(220, 15%, 55%, 0.3) !important;
  }
}

/* Desktop web: pointer cursor on interactive elements */
@media (hover: hover) {
  [role="button"],
  button,
  a {
    cursor: pointer;
  }
}

/* ===== DATA CARD ===== */
.data-card {
  border-radius: 12px;
  border: 1px solid hsl(220, 18%, 18% / 0.6);
  overflow: hidden;
}

/* ===== CHAT TABLE ===== */
.chat-table {
  width: 100%;
  font-size: 0.875rem;
}

.chat-table thead tr {
  border-bottom: 2px solid hsl(19 89% 54% / 0.2);
  background: linear-gradient(90deg, hsl(19 89% 54% / 0.05) 0%, transparent 50%, hsl(19 89% 54% / 0.05) 100%);
}

.chat-table thead th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(19, 89%, 54%);
  white-space: nowrap;
}

.chat-table tbody tr {
  border-bottom: 1px solid hsl(220, 20%, 20% / 0.3);
  transition: background-color 0.15s;
}

.chat-table tbody tr:hover {
  background: hsl(19 89% 54% / 0.05);
}

.chat-table tbody td {
  padding: 10px 12px;
  white-space: nowrap;
}

/* ===== MESSAGE ANIMATIONS ===== */
@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-animate {
  animation: message-in 0.3s ease-out forwards;
}

/* ===== THINKING INDICATOR ===== */
@keyframes thinking-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.thinking-pulse {
  animation: thinking-pulse 1.2s ease-in-out infinite;
}

.thinking-text {
  transition: opacity 0.2s ease;
}

/* ===== STREAMING CURSOR ===== */
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.streaming-cursor::after {
  content: '\2588';
  display: inline-block;
  margin-left: 2px;
  color: hsl(19, 89%, 54%);
  animation: cursor-blink 0.8s step-end infinite;
}

/* ===== LOADING SHIMMER ===== */
@keyframes data-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.data-loading {
  background: linear-gradient(
    90deg,
    hsl(220, 20%, 18%) 0%,
    hsl(220, 15%, 55% / 0.1) 50%,
    hsl(220, 20%, 18%) 100%
  );
  background-size: 200% 100%;
  animation: data-shimmer 1.5s ease-in-out infinite;
}

/* ===== NO SCROLLBAR (full-page scroll containers) ===== */
.pv-no-scrollbar { scrollbar-width: none !important; }
.pv-no-scrollbar::-webkit-scrollbar { display: none !important; }

/* ===== THIN SCROLLBAR ===== */
.pv-thin-scrollbar-x {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.pv-thin-scrollbar-x:hover,
.pv-thin-scrollbar-x:active {
  scrollbar-color: hsla(220, 15%, 55%, 0.3) transparent;
}
.pv-thin-scrollbar-x::-webkit-scrollbar {
  height: 4px;
}
.pv-thin-scrollbar-x::-webkit-scrollbar-track {
  background: transparent;
}
.pv-thin-scrollbar-x::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 9999px;
}
.pv-thin-scrollbar-x:hover::-webkit-scrollbar-thumb,
.pv-thin-scrollbar-x:active::-webkit-scrollbar-thumb {
  background-color: hsla(220, 15%, 55%, 0.3);
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
  background-color: hsl(220, 25%, 12%);
  border: 1px solid hsl(220, 20%, 30% / 0.5);
  border-radius: 12px;
  padding: 16px;
  min-width: 176px;
  box-shadow: 0 10px 38px hsl(0 0% 0% / 0.35), 0 10px 20px hsl(0 0% 0% / 0.2);
  z-index: 50;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: hsl(210, 20%, 98%);
  cursor: pointer;
  transition: background-color 0.15s;
}

.dropdown-item:hover {
  background-color: hsl(220, 20%, 18% / 0.6);
}

.dropdown-item-active {
  background-color: hsl(220, 20%, 18% / 0.6);
}

.dropdown-item-destructive:hover {
  background-color: hsl(0, 60%, 40% / 0.15);
}

.dropdown-separator {
  height: 1px;
  background-color: hsl(220, 20%, 30% / 0.4);
  margin: 4px 8px;
}

/* ===== PROMPT / ACTION CHIP HOVER (base styles via NativeWind) ===== */
.prompt-chip,
.action-chip {
  transition: all 0.2s;
  cursor: pointer;
}
.prompt-chip {
  border-radius: 9999px;
}
.prompt-chip:hover {
  background-color: hsl(220, 25%, 12%);
  border-color: hsl(220, 16%, 22%);
}
.action-chip:hover {
  background-color: hsl(220, 25%, 13%);
  border-color: hsl(19 89% 54% / 0.15);
  box-shadow: 0 0 12px 0 hsl(19 89% 54% / 0.06);
}
.prompt-chip:active,
.action-chip:active {
  background-color: hsl(220, 25%, 15%);
  transform: scale(0.97);
}

/* ===== SIDEBAR SCROLLBAR ===== */
.sidebar-scroll {
  scrollbar-width: thin !important;
  scrollbar-color: hsla(220, 15%, 55%, 0.15) transparent !important;
}
.sidebar-scroll:hover {
  scrollbar-color: hsla(220, 15%, 55%, 0.25) transparent !important;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px !important; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent !important; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: hsla(220, 15%, 55%, 0.15) !important;
  border-radius: 9999px !important;
}
.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background-color: hsla(220, 15%, 55%, 0.25) !important;
}

/* ===== SIDEBAR INTERACTION ===== */
.sidebar-conv-item { transition: background-color 0.15s; }
.sidebar-conv-item:hover { background-color: hsl(220, 22%, 15% / 0.5); }
.sidebar-menu-btn { opacity: 0; transition: opacity 0.15s; }
.sidebar-conv-item:hover .sidebar-menu-btn,
.sidebar-menu-btn.menu-open { opacity: 1; }
.sidebar-action-btn { transition: background-color 0.15s; }
.sidebar-action-btn:hover { background-color: hsl(220, 22%, 15% / 0.5); }

/* ===== PANEL ANIMATIONS ===== */
@keyframes panel-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes panel-slide-out {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== BADGE + LEG ANIMATIONS ===== */
@keyframes badge-pop-in {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.badge-pop-in {
  animation: badge-pop-in 0.25s ease-out forwards;
}

@keyframes leg-slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
.leg-slide-in {
  animation: leg-slide-in 0.2s ease-out forwards;
}

@keyframes count-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.count-bump {
  animation: count-bump 0.3s ease-out;
}

@keyframes check-pop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.check-pop {
  animation: check-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== SHOT CHART DOT ===== */
@keyframes shot-dot-in {
  from { opacity: 0; r: 0; }
  to { opacity: 1; }
}

/* ===== INPUT GLOW ===== */
.chat-input-glow {
  transition: box-shadow 0.3s, border-color 0.3s;
}
.chat-input-glow:focus-within {
  box-shadow: 0 0 16px 2px hsl(19 89% 54% / 0.12);
  border-color: hsl(19 89% 54% / 0.3);
}

/* ===== EMPTY STATE ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state-bg {
  background:
    radial-gradient(
      ellipse 600px 400px at center 36%,
      hsl(19 89% 54% / 0.12) 0%,
      transparent 70%
    ),
    radial-gradient(
      circle 300px at 70% 50%,
      hsl(220 60% 30% / 0.06) 0%,
      transparent 100%
    );
}

/* History pill hover */
.history-pill {
  transition: all 0.2s;
  cursor: pointer;
}
.history-pill:hover {
  background-color: hsl(220, 22%, 15%);
  border-color: hsl(220, 16%, 25%);
}


/* ===== SKELETON BREATHE (empty state — not a loading indicator) ===== */
@keyframes skeleton-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.skeleton-breathe {
  animation: skeleton-breathe 3s ease-in-out infinite;
}

/* ===== FADE-UP (for staggered chip animation) ===== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fade-up 0.4s ease-out forwards;
  opacity: 0;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton-breathe,
  .animate-fade-up,
  .message-animate,
  .thinking-pulse,
  .badge-pop-in,
  .leg-slide-in,
  .count-bump,
  .check-pop {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  /* Inline style animations (empty state entrance, float) — instant */
  [style*="animation: fade-up"],
  [style*="animation: float"] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== SCALE IN ===== */
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.animate-scale-in {
  animation: scale-in 0.2s ease-out forwards;
}

/* ===== COURT LINE AESTHETICS (shot chart) ===== */
:root {
  --court-bg: hsl(220, 28%, 7%);
  --court-line: hsl(220, 15%, 30%);
  --court-line-dim: hsl(220, 15%, 20%);
  --shot-made: hsl(145, 70%, 45%);
  --shot-missed: hsl(0, 75%, 55%);
}
