/* ============================================
   PokerScreenReader - Dashboard Styles
   Dark poker theme with greens and blacks
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --bg-input: #0d1b3e;
  --bg-sidebar: #0e1628;
  --bg-hover: #1a2a50;
  --accent: #e94560;
  --accent-green: #00b894;
  --accent-yellow: #fdcb6e;
  --accent-blue: #74b9ff;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #6c6c8a;
  --border-color: #1e3054;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 250px;
  --header-height: 60px;
  --transition: all 0.3s ease;
}

/* --- Reset / Normalize --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

ul, ol {
  list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 0.75rem;
}

/* --- Layout --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.sidebar-logo .logo-icon {
  font-size: 1.6rem;
  margin-right: 0.25rem;
}

.sidebar-status {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sidebar-python-btn, .sidebar-hr-btn {
  margin-left: auto;
  background: #00b894;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.sidebar-python-btn:hover, .sidebar-hr-btn:hover { opacity: 0.85; }
.sidebar-python-btn.running, .sidebar-hr-btn.running { background: #e74c3c; }
.sidebar-python-btn.loading, .sidebar-hr-btn.loading { background: #f39c12; cursor: wait; }
.hr-status-text { font-size: 0.8rem; color: var(--text-secondary); }
.hr-status-text.text-green { color: #00b894; }
.hr-status-text.text-red { color: #e74c3c; }
.hr-status-text.text-yellow { color: #f39c12; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-nav .nav-section {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: var(--accent);
}

.sidebar-nav .nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav .nav-link .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  margin-bottom: 0;
}

.page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Status Indicator Dot --- */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  transition: var(--transition);
}

.status-dot.connected {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(0, 184, 148, 0.6);
  animation: pulse-green 2s infinite;
}

.status-dot.disconnected {
  background-color: var(--accent);
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 4px rgba(0, 184, 148, 0.4); }
  50% { box-shadow: 0 0 12px rgba(0, 184, 148, 0.8); }
  100% { box-shadow: 0 0 4px rgba(0, 184, 148, 0.4); }
}

/* --- Live Data Pulse Animation --- */
@keyframes live-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent-green);
  font-weight: 600;
}

.live-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: live-pulse 1.5s ease-in-out infinite;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3,
.card-header h4 {
  margin-bottom: 0;
}

.card-body {
  padding: 0;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* Status Cards Row */
.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.status-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-card .status-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.status-card .status-info h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.status-card .status-info .status-value {
  font-size: 1.3rem;
  font-weight: 700;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr.clickable {
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

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

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

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #d13752;
}

.btn-success {
  background: var(--accent-green);
  color: #fff;
}

.btn-success:hover {
  background: #00a382;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
}

.btn-danger:hover {
  background: #a93226;
}

.btn-secondary {
  background: #3d3d5c;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #4d4d6d;
}

.btn-warning {
  background: var(--accent-yellow);
  color: #1a1a2e;
}

.btn-warning:hover {
  background: #f0bd4e;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1rem;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #3d3d5c;
  border-radius: 28px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(28px);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Range slider */
.range-group {
  margin-bottom: 1.25rem;
}

.range-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.range-group label .range-value {
  color: var(--accent-yellow);
  font-weight: 700;
  font-size: 0.95rem;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-input);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 184, 148, 0.3);
}

.badge-danger {
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  border: 1px solid rgba(233, 69, 96, 0.3);
}

.badge-warning {
  background: rgba(253, 203, 110, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(253, 203, 110, 0.3);
}

.badge-info {
  background: rgba(116, 185, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(116, 185, 255, 0.3);
}

.badge-neutral {
  background: rgba(160, 160, 160, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(160, 160, 160, 0.3);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.pagination .page-btn {
  padding: 0.4rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.pagination .page-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination .page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0.5rem;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toast.toast-success {
  background: #00a382;
  border-left: 4px solid var(--accent-green);
}

.toast.toast-error {
  background: #a93226;
  border-left: 4px solid var(--accent);
}

.toast.toast-info {
  background: #2563a0;
  border-left: 4px solid var(--accent-blue);
}

.toast.toast-warning {
  background: #a07d25;
  border-left: 4px solid var(--accent-yellow);
}

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

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

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

/* --- Poker Table (Live View) --- */
.poker-table-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.poker-table {
  position: relative;
  width: 700px;
  height: 380px;
  background: radial-gradient(ellipse at center, #1b5e20 0%, #0d3310 60%, #091f0a 100%);
  border-radius: 50%;
  border: 8px solid #2e1f0f;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poker-table .table-pot {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-yellow);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
}

.poker-table .table-phase {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.community-cards {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.card-slot {
  width: 60px;
  height: 85px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-slot.filled {
  background: #fff;
  color: #1a1a2e;
  border: 2px solid #ccc;
  text-shadow: none;
}

.card-slot.filled.red {
  color: #e94560;
}

.card-slot.filled.black {
  color: #1a1a2e;
}

.my-cards {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 1rem 0;
}

.my-cards .card-slot {
  width: 72px;
  height: 100px;
  font-size: 1.4rem;
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 15px rgba(253, 203, 110, 0.3);
}

/* Equity gauge */
.equity-gauge {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-green) calc(var(--equity, 0) * 3.6deg), rgba(255, 255, 255, 0.08) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 1rem auto;
}

.equity-gauge .gauge-inner {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.equity-gauge .gauge-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-green);
}

.equity-gauge .gauge-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Recommendation badge */
.recommendation {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.recommendation.fold {
  background: rgba(233, 69, 96, 0.2);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.recommendation.call {
  background: rgba(253, 203, 110, 0.2);
  color: var(--accent-yellow);
  border: 2px solid var(--accent-yellow);
}

.recommendation.raise {
  background: rgba(0, 184, 148, 0.2);
  color: var(--accent-green);
  border: 2px solid var(--accent-green);
}

.recommendation.check {
  background: rgba(116, 185, 255, 0.2);
  color: var(--accent-blue);
  border: 2px solid var(--accent-blue);
}

/* --- Screenshot / Placeholder --- */
.screenshot-area {
  width: 100%;
  min-height: 300px;
  background: var(--bg-input);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.screenshot-area .placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
}

/* --- Template Grid --- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.template-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
  transition: var(--transition);
}

.template-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.template-item .template-image {
  width: 60px;
  height: 85px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
}

.template-item .template-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.template-item .template-confidence {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* --- Chart Containers --- */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem;
}

/* --- Region Editor (Calibration) --- */
.region-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.region-item {
  display: grid;
  grid-template-columns: 180px repeat(4, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.region-item .region-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-blue);
}

.region-item .form-control {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  text-align: center;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.filter-bar .form-group {
  margin-bottom: 0;
}

.filter-bar .form-control {
  min-width: 140px;
}

/* --- Utility Classes --- */
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent) !important; }
.text-yellow { color: var(--accent-yellow) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-mono { font-family: 'Consolas', 'Courier New', monospace; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.visible { display: block !important; }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }

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

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }

.clickable { cursor: pointer; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.95rem;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  .region-item {
    grid-template-columns: 1fr 1fr;
  }

  .region-item .region-name {
    grid-column: 1 / -1;
  }

  .poker-table {
    width: 100%;
    max-width: 500px;
    height: 280px;
  }
}

@media (max-width: 768px) {
  html { font-size: 13px; }

  .status-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

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

  .community-cards .card-slot {
    width: 48px;
    height: 68px;
    font-size: 1rem;
  }

  .my-cards .card-slot {
    width: 56px;
    height: 80px;
    font-size: 1.2rem;
  }
}

/* Mobile menu button (hidden by default on desktop) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2a4070;
}

/* --- Hand Detail Expanded Row --- */
.hand-detail {
  display: none;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin: 0.5rem 0;
}

.hand-detail.expanded {
  display: block;
}

.hand-detail .phase-actions {
  margin-bottom: 0.75rem;
}

.hand-detail .phase-actions h5 {
  color: var(--accent-blue);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.hand-detail .phase-actions p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-secondary);
}
