/**
 * Main CSS Framework for The Players Clubhouse
 * Golf-themed design system with responsive utilities
 */

/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
  /* Golf-themed Color Palette */
  --color-fairway: #7CFC00;
  --color-green: #228B22;
  --color-rough: #355E3B;
  --color-sand: #F4A460;
  --color-water: #4682B4;
  --color-tee: #1e5f3e;
  --color-pin: #dc2626;
  
  /* Primary Colors */
  --color-primary: #1e5f3e;
  --color-primary-light: #2a7f52;
  --color-primary-dark: #14452b;
  --color-secondary: #059669;
  --color-accent: #10b981;
  
  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* Status Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: var(--color-gray-900);
    --color-text: var(--color-gray-100);
  }
}

/* ============================================
   Base Styles & Reset
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

/* ============================================
   Layout Components
   ============================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   Cards & Containers
   ============================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-gray-200);
}

.card-body {
  padding: var(--space-4) 0;
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-gray-200);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}

.btn-success {
  background-color: var(--color-success);
  color: var(--color-white);
  border-color: var(--color-success);
}

.btn-danger {
  background-color: var(--color-error);
  color: var(--color-white);
  border-color: var(--color-error);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
  min-height: 52px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-gray-900);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 95, 62, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
}

/* Form Validation States */
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--color-error);
}

.form-input.is-valid,
.form-select.is-valid,
.form-textarea.is-valid {
  border-color: var(--color-success);
}

.form-error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-error);
}

.form-hint {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

/* ============================================
   Alerts & Notifications
   ============================================ */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background-color: #fed7aa;
  color: #92400e;
  border: 1px solid #fdba74;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  max-width: min(400px, calc(100vw - 2rem));
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   Loading States
   ============================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gray-300);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Golf-Specific Components
   ============================================ */
.scorecard-table {
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.scorecard-table th {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  padding: var(--space-3);
  text-align: center;
  font-weight: 600;
}

.scorecard-table td {
  padding: var(--space-2);
  text-align: center;
  border-bottom: 1px solid var(--color-gray-200);
}

.scorecard-table tr:hover {
  background-color: var(--color-gray-50);
}

/* Event scorecard horizontal-scroll affordance (mobile). The fade hints that
   the hole columns continue past the right edge; pointer-events:none so it
   never blocks taps on the sticky TOT column or the score cells. */
.sc-scroll-wrap {
  position: relative;
}
.sc-scroll-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
}
@media (min-width: 768px) {
  .sc-scroll-fade {
    display: none;
  }
}

/* Course Card */
.course-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition-base);
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.course-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-fairway) 0%, var(--color-green) 100%);
}

.course-card-body {
  padding: var(--space-4);
}

.course-card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.course-card-meta {
  display: flex;
  gap: var(--space-4);
  color: var(--color-gray-600);
  font-size: var(--text-sm);
}

/* Handicap Badge */
.handicap-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ============================================
   Utilities
   ============================================ */

/* Alpine.js cloak — hides elements until Alpine initializes */
[x-cloak] { display: none !important; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

/* Text */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Colors */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-gray-600); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-success { background-color: var(--color-success); }
.bg-error { background-color: var(--color-error); }
.bg-warning { background-color: var(--color-warning); }
.bg-white { background-color: var(--color-white); }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }

/* Borders */
.border { border: 1px solid var(--color-gray-300); }
.border-top { border-top: 1px solid var(--color-gray-300); }
.border-bottom { border-bottom: 1px solid var(--color-gray-300); }
.border-left { border-left: 1px solid var(--color-gray-300); }
.border-right { border-right: 1px solid var(--color-gray-300); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile First Breakpoints */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:d-block { display: block; }
  .sm\:d-none { display: none; }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:d-block { display: block; }
  .md\:d-none { display: none; }
  .md\:d-flex { display: flex; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:d-block { display: block; }
  .lg\:d-none { display: none; }
  .lg\:d-flex { display: flex; }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
  .xl\:d-block { display: block; }
  .xl\:d-none { display: none; }
}

/* Mobile-Specific Adjustments */
@media (max-width: 639px) {
  body {
    font-size: var(--text-sm);
  }
  
  .container {
    padding: 0 var(--space-3);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .btn {
    width: 100%;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Mobile Navigation */
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-around;
    padding: var(--space-2) 0;
    z-index: var(--z-sticky);
  }
  
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2);
    color: var(--color-gray-600);
    text-decoration: none;
    font-size: var(--text-xs);
  }
  
  .mobile-nav-item.active {
    color: var(--color-primary);
  }
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
  
  .no-print,
  nav,
  .mobile-nav,
  .btn,
  .toast {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Tournament Match Type Badges
   ============================================ */
.match-type-badge {
  display: inline-block;
  white-space: nowrap;
}
.match-type-stroke_play { background-color: #dcfce7; color: #166534; }
.match-type-match_play  { background-color: #dbeafe; color: #1e40af; }
.match-type-stableford  { background-color: #fef3c7; color: #92400e; }
.match-type-best_ball   { background-color: #ccfbf1; color: #115e59; }
.match-type-scramble    { background-color: #ffedd5; color: #9a3412; }
.match-type-skins       { background-color: #fef9c3; color: #854d0e; }
.match-type-nassau      { background-color: #ede9fe; color: #5b21b6; }

/* ============================================
   Matchup Prep Tool - Responsive
   ============================================ */
@media (max-width: 1023px) {
  /* Stack the 3-column layout on tablet/mobile */
  .container > [style*="min-height"] {
    flex-direction: column;
  }
  /* Player pool becomes horizontal scrollable strip */
  .container > [style*="min-height"] > .w-64 {
    width: 100%;
  }
  .container > [style*="min-height"] > .w-64 #playerPool {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    max-height: none;
  }
  .container > [style*="min-height"] > .w-64 #playerPool .player-card {
    min-width: 160px;
    flex-shrink: 0;
  }
}

/* Touch-friendly drop zones */
@media (pointer: coarse) {
  .drop-zone {
    min-height: 56px;
  }
  .player-card {
    padding: 12px;
  }
}

/* ============================================
   Pretext Tooltip System (Phase 3)
   ============================================ */
.tpc-tooltip {
  position: fixed;
  z-index: 1070;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 150ms ease;
  max-width: 300px;
}

.tpc-tooltip-content {
  background: #1f2937;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tpc-tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #1f2937;
  transform: rotate(45deg);
}

.tpc-tooltip[data-placement="top"] .tpc-tooltip-arrow {
  bottom: -4px;
}

.tpc-tooltip[data-placement="bottom"] .tpc-tooltip-arrow {
  top: -4px;
}

.tpc-tooltip[data-placement="left"] .tpc-tooltip-arrow {
  right: -4px;
  top: 50%;
  margin-top: -4px;
}

.tpc-tooltip[data-placement="right"] .tpc-tooltip-arrow {
  left: -4px;
  top: 50%;
  margin-top: -4px;
}

/* ============================================
   Virtual Scroll Container (Phase 5)
   ============================================ */
.tpc-virtual-container {
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tpc-virtual-container::-webkit-scrollbar {
  width: 6px;
}

.tpc-virtual-container::-webkit-scrollbar-track {
  background: transparent;
}

.tpc-virtual-container::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.tpc-virtual-container::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}