/* ============================================================
   Baseball/Softball Athlete Database — Custom CSS
   กฎ: ห้ามใช้ inline style="..." ใน HTML ทุกอย่างอยู่ที่นี่
   ธีม: Cyberpunk Neon — Black / Green #4af828 / Pink #f82885
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* พื้นหลัง (black 60%) */
  --bg:          #000000;
  --bg-2:        #0a0a0a;
  --card:        #0f0f0f;
  --card-hover:  #161616;
  --border:      #1a1a1a;
  --border-light:#262626;

  /* สีหลัก green #4af828 (15%) */
  --gold:        #4af828;
  --gold-dim:    rgba(74, 248, 40, 0.10);
  --gold-mid:    rgba(74, 248, 40, 0.22);

  /* สีรอง pink #f82885 (5%) */
  --blue:        #f82885;
  --blue-dim:    rgba(248, 40, 133, 0.10);

  /* Functional colors */
  --red:         #ef4444;
  --green:       #4af828;

  /* ข้อความ (white 5% + opacity scale) */
  --text:        #ffffff;
  --text-sec:    rgba(255, 255, 255, 0.55);
  --text-muted:  rgba(255, 255, 255, 0.28);

  /* Layout */
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius-xl:   20px;
  --radius-lg:   16px;
  --radius-md:   12px;
  --radius-sm:   8px;
  --radius-xs:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,0.7);
  --t:           0.2s ease;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; color: var(--text); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; }
textarea { resize: vertical; }

/* ── Public Site ───────────────────────────────────────── */
.public-body { background-color: var(--bg); }

/* Navbar */
.pub-navbar {
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.pub-navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 0;
}
.pub-brand {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text); font-weight: 800; font-size: 1.25rem;
  transition: color var(--t);
}
.pub-brand:hover { color: var(--gold); }
.pub-brand-icon { color: var(--gold); font-size: 1.5rem; }
.pub-nav-right  { display: flex; align-items: center; gap: 0.75rem; }
.pub-nav-btn {
  display: inline-flex; align-items: center; font-size: 0.85rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); transition: all var(--t);
  white-space: nowrap;
}
.pub-nav-btn--admin  { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-mid); }
.pub-nav-btn--admin:hover { background: var(--gold-mid); color: var(--gold); }
.pub-nav-btn--outline { background: transparent; color: var(--text-sec); border: 1px solid var(--border-light); }
.pub-nav-btn--outline:hover { border-color: var(--gold); color: var(--gold); }

/* Main & Footer */
.pub-main { min-height: calc(100vh - 64px - 60px); }
.pub-footer { background: var(--card); border-top: 1px solid var(--border); padding: 1.25rem 0; }
.pub-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pub-footer-brand { color: var(--gold); font-weight: 700; }
.pub-footer-copy  { color: var(--text-muted); font-size: 0.8rem; }

/* Sponsor Bar */
.sponsor-bar {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sponsor-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); white-space: nowrap;
}
.sponsor-list { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sponsor-item {
  display: block; width: 80px; height: 80px;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-2);
  transition: border-color var(--t), transform var(--t);
  flex-shrink: 0;
}
.sponsor-item:hover { border-color: var(--gold); transform: translateY(-2px); }
.sponsor-item img { width: 80px; height: 80px; object-fit: cover; display: block; }

/* ── Hero Section ──────────────────────────────────────── */
.hero-section {
  background: radial-gradient(ellipse at 50% 0%, rgba(74,248,40,0.10) 0%, transparent 60%), var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero-content { max-width: 600px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center;
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid var(--gold-mid); border-radius: 99px;
  padding: 0.375rem 1rem; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.hero-title { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; color: var(--text); line-height: 1.2; margin: 0 0 1rem; }
.hero-subtitle { color: var(--text-sec); font-size: 1rem; margin: 0; }

/* ── Section Headings ──────────────────────────────────── */
.section-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.section-title   { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 0; }
.section-count   { background: var(--gold-dim); color: var(--gold); border-radius: 99px; padding: 0.2rem 0.75rem; font-size: 0.8rem; font-weight: 600; }

/* ── Team Cards (Home) ─────────────────────────────────── */
.team-card {
  background: var(--card); border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden; transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  color: var(--text);
}
.team-card:hover {
  transform: translateY(-4px); border-color: var(--gold);
  box-shadow: 0 12px 40px rgba(74,248,40,0.12);
}
.team-card-logo {
  height: 200px; background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden; position: relative;
}
.team-card-logo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.team-logo-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim); color: var(--gold);
  font-size: 2rem; font-weight: 800;
}
.team-logo-lg { width: 90px; height: 90px; font-size: 1.75rem; }
.team-card-body { padding: 1.25rem 1.25rem 0.75rem; }
.team-card-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0 0 0.5rem; }
.team-card-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.team-athlete-count { color: var(--text-sec); font-size: 0.8rem; }
.team-card-desc { color: var(--text-muted); font-size: 0.8rem; margin: 0.5rem 0 0; }
.team-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem; color: var(--gold); font-size: 0.85rem; font-weight: 500;
  border-top: 1px solid var(--border);
}

/* ── Sport Type Badges ─────────────────────────────────── */
.sport-badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem; border-radius: 99px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
/* baseball → สีชมพู (--blue) */
.sport-badge--baseball { background: rgba(248,40,133,0.15); color: #fb5ca9; }
/* softball → สีเขียว (--gold) */
.sport-badge--softball { background: rgba(74,248,40,0.15); color: #4af828; }
.sport-badge-lg  { font-size: 0.8rem;  padding: 0.35rem 0.9rem; }
.sport-badge-xs  { font-size: 0.65rem; padding: 0.15rem 0.5rem; }

/* ── Team Header (Roster page) ─────────────────────────── */
.team-header { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.team-header-logo img { width: 72px; height: 72px; object-fit: contain; }
.team-header-name { font-size: 1.75rem; font-weight: 800; margin: 0; }
.team-header-desc { color: var(--text-sec); font-size: 0.9rem; margin: 0; }

/* ── Athlete Cards (Roster) ────────────────────────────── */
.athlete-card {
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden; transition: transform var(--t), border-color var(--t);
  color: var(--text);
}
.athlete-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.athlete-card-photo { aspect-ratio: 1/1; background: var(--bg-2); overflow: hidden; }
.athlete-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.athlete-card:hover .athlete-card-photo img { transform: scale(1.05); }
.athlete-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 3rem;
}
.athlete-card-body { padding: 0.75rem; }
.athlete-card-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.athlete-card-age { font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }
.athlete-hand-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* Hand Badges */
.hand-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px; font-size: 0.7rem; font-weight: 600;
}
.hand-badge--bat   { background: rgba(74,248,40,0.15);  color: var(--gold); }
.hand-badge--left  { background: rgba(248,40,133,0.15); color: #fb5ca9; }
.hand-badge--right { background: rgba(74,248,40,0.12);  color: #4af828; }
.hand-badge--both  { background: rgba(168,85,247,0.15); color: #c084fc; }
.hand-badge--throw { background: rgba(255,255,255,0.07); color: var(--text-sec); }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb-nav { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; flex-wrap: wrap; }
.breadcrumb-nav a { color: var(--text-sec); transition: color var(--t); }
.breadcrumb-nav a:hover { color: var(--gold); }
.breadcrumb-nav span { color: var(--text); }
.breadcrumb-sep { color: var(--text-muted); font-size: 0.7rem; }

/* ── Athlete Profile Page ──────────────────────────────── */
.profile-hero { background: var(--card); border-radius: var(--radius-xl); padding: 2rem; border: 1px solid var(--border); }
.profile-photo-wrap { position: relative; display: inline-block; }
.profile-photo {
  width: 160px; height: 160px; border-radius: var(--radius-xl);
  object-fit: cover; border: 3px solid var(--border-light);
}
.profile-photo-placeholder {
  width: 160px; height: 160px; border-radius: var(--radius-xl);
  background: var(--bg-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 4rem; border: 3px solid var(--border-light);
}
.profile-sport-badge { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); }
.team-name-label { color: var(--gold); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.profile-name { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; margin: 0 0 0.75rem; }
.profile-meta-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.profile-meta-item { display: flex; flex-direction: column; }
.meta-label { font-size: 0.72rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.06em; }
.meta-value { font-size: 1rem; font-weight: 600; color: var(--text); }
.handedness-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.handedness-item { display: flex; align-items: center; gap: 0.5rem; }
.handedness-label { font-size: 0.8rem; color: var(--text-sec); }
.handedness-value { font-weight: 600; padding: 0.2rem 0.65rem; border-radius: 4px; font-size: 0.85rem; background: var(--gold-dim); color: var(--gold); }

/* Performance Metrics */
.metric-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; text-align: center;
}
.metric-icon { font-size: 1.75rem; color: var(--gold); margin-bottom: 0.5rem; }
.metric-label { font-size: 0.75rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.metric-value { font-size: 1.75rem; font-weight: 800; color: var(--text); }

/* Skill Tabs */
.skill-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; border: none; padding: 0; }
.skill-tab-btn {
  display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-sec); border-radius: var(--radius-sm);
  padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--t);
}
.skill-tab-btn:hover { border-color: var(--gold); color: var(--gold); }
/* ข้อความบน accent สว่างต้องใช้สีดำ */
.skill-tab-btn.active { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600; }
.skill-caption {
  display: flex; gap: 0.75rem;
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.skill-caption-icon { color: var(--gold); font-size: 1.1rem; flex-shrink: 0; }
.skill-caption p    { margin: 0; color: var(--text-sec); font-size: 0.9rem; line-height: 1.7; }
.media-section-title { color: var(--text-sec); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Image Gallery */
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.gallery-thumb { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1/1; cursor: pointer; border: 1px solid var(--border); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.gallery-thumb:hover img { transform: scale(1.08); }
.gallery-thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.5rem; opacity: 0; transition: opacity var(--t);
}
.gallery-thumb:hover .gallery-thumb-overlay { opacity: 1; }

/* Video Cards */
.video-card { background: var(--card); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; }
.video-player { width: 100%; height: auto; max-height: 75vh; background: #000; display: block; }
.video-card-footer {
  padding: 0.625rem 0.875rem; font-size: 0.78rem; color: var(--text-sec);
  display: flex; align-items: center; gap: 0.5rem;
}
.video-size { margin-left: auto; color: var(--text-muted); }
.video-download-btn { color: var(--text-muted); transition: color var(--t); }
.video-download-btn:hover { color: var(--gold); }
.text-gold { color: var(--gold); }

/* ── FFmpeg.wasm Conversion Overlay ───────────────────── */
.ffmpeg-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.ffmpeg-overlay.active { display: flex; }
.ffmpeg-box {
  background: var(--card); border: 1px solid var(--gold-mid);
  border-radius: var(--radius-xl); padding: 2.5rem 2rem;
  text-align: center; max-width: 400px; width: 90%;
  box-shadow: 0 0 48px rgba(74,248,40,0.18);
}
.ffmpeg-spinner { font-size: 2.5rem; color: var(--gold); margin-bottom: 1rem; display: inline-block; animation: ffSpin 1s linear infinite; }
@keyframes ffSpin { to { transform: rotate(360deg); } }
.ffmpeg-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.375rem; }
.ffmpeg-file  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.25rem; min-height: 1.4em; word-break: break-all; }
.ffmpeg-bar-wrap { background: var(--bg-2); border-radius: 99px; height: 8px; overflow: hidden; margin-bottom: 0.5rem; }
.ffmpeg-bar  { height: 100%; background: var(--gold); border-radius: 99px; width: 0%; transition: width 0.25s ease; }
.ffmpeg-pct  { font-size: 1.1rem; font-weight: 700; color: var(--gold); margin-bottom: 0.875rem; }
.ffmpeg-counter { font-size: 0.78rem; color: var(--text-sec); margin-bottom: 0.5rem; min-height: 1.2em; }
.ffmpeg-note { font-size: 0.75rem; color: var(--text-muted); }
.convert-done-item { color: var(--green); font-size: 0.8rem; padding: 0.2rem 0; }

/* Lightbox Modal */
.modal-dark { background: rgba(0,0,0,0.96); border: 1px solid var(--border); }
.modal-full-img { max-height: 80vh; max-width: 100%; object-fit: contain; }
.modal-title-text { color: var(--text-sec); font-size: 0.85rem; }

/* ── Admin Layout ──────────────────────────────────────── */
.admin-body { background: var(--bg); }
.admin-sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.25rem;
  z-index: 200; overflow-y: auto;
  transition: transform var(--t);
}
.admin-sidebar-brand { display: flex; flex-direction: column; padding: 0.5rem 0.5rem 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.admin-brand-icon { color: var(--gold); font-size: 1.75rem; }
.admin-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.admin-brand-sub  { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.admin-sidebar-user { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.admin-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-dim); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.admin-user-name   { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.admin-user-role   { font-size: 0.7rem; color: var(--text-muted); }
.admin-nav { list-style: none; margin: 0; padding: 0; flex: 1; }
.admin-nav-item { margin-bottom: 2px; }
.admin-nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--text-sec); font-size: 0.875rem; font-weight: 500;
  transition: background var(--t), color var(--t);
}
.admin-nav-link i { font-size: 1rem; width: 18px; flex-shrink: 0; }
.admin-nav-link:hover, .admin-nav-item.active .admin-nav-link { background: var(--gold-dim); color: var(--gold); }
.admin-logout:hover { background: rgba(239,68,68,0.1) !important; color: var(--red) !important; }
.admin-sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Admin Main */
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin var(--t); }
.admin-topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.admin-toggle-btn {
  display: none; background: none; border: none; color: var(--text-sec);
  font-size: 1.5rem; cursor: pointer; padding: 0.25rem;
}
.admin-page-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; flex: 1; }
.admin-view-site-btn { font-size: 0.8rem; color: var(--text-sec); display: flex; align-items: center; transition: color var(--t); }
.admin-view-site-btn:hover { color: var(--gold); }
.admin-content { padding: 1.5rem; flex: 1; }

/* Admin Overlay */
.admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 150; }
.admin-overlay.show { display: block; }

/* Admin Cards */
.admin-card { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.5rem; }
.admin-card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.admin-card-title  { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.admin-card-subtitle { font-size: 0.85rem; font-weight: 600; color: var(--text-sec); margin: 0; }
.admin-link-btn    { font-size: 0.8rem; color: var(--gold); font-weight: 500; }
.admin-link-btn:hover { color: #6ffb4a; }
.admin-section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.admin-section-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #000;
  font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-section-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.admin-section-hint  { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }

/* Admin Stat Cards */
.admin-stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; }
.admin-stat-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 0.75rem; }
.admin-stat-icon--teams   { background: var(--blue-dim); color: var(--blue); }
.admin-stat-icon--athletes{ background: var(--gold-dim); color: var(--gold); }
.admin-stat-value { font-size: 2.25rem; font-weight: 800; color: var(--text); }
.admin-stat-label { font-size: 0.78rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.06em; }
.admin-quick-action {
  background: var(--blue-dim); border: 1px solid rgba(248,40,133,0.25);
  border-radius: var(--radius-lg); padding: 1.5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--blue); font-weight: 600; font-size: 0.875rem; min-height: 100%;
  transition: background var(--t), transform var(--t);
}
.admin-quick-action:hover { background: rgba(248,40,133,0.20); transform: translateY(-2px); color: var(--blue); }
.admin-quick-action i { font-size: 1.75rem; }
.admin-quick-action--gold { background: var(--gold-dim); border-color: var(--gold-mid); color: var(--gold); }
.admin-quick-action--gold:hover { background: var(--gold-mid); color: var(--gold); }

/* Admin Tables */
/* ── Admin Filter Bar ──────────────────────────────────── */
.admin-filter-bar {
  display: flex; align-items: center; gap: 0.625rem; flex-wrap: nowrap;
}
.admin-filter-bar .form-select-dark { width: auto; min-width: 150px; flex-shrink: 0; }
.admin-filter-search {
  position: relative; flex: 1; min-width: 140px;
}
@media (max-width: 767px) {
  .admin-filter-bar { flex-wrap: wrap; }
  .admin-filter-bar .form-select-dark { width: 100%; }
}
.admin-filter-search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.8rem; pointer-events: none;
}
.admin-filter-input {
  width: 100%; padding: 0.45rem 0.875rem 0.45rem 2.1rem;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.85rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.admin-filter-input::placeholder { color: var(--text-muted); }
.admin-filter-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* ── Admin Table ───────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-logo { height: 80px; border-radius: var(--radius-xs); object-fit: contain; }
.table-logo-placeholder { width: 36px; height: 36px; border-radius: var(--radius-xs); background: var(--gold-dim); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.table-athlete-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.table-athlete-photo--placeholder { background: var(--bg-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.table-action-btn {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-sec); display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t); font-size: 0.8rem;
}
.table-action-btn:hover { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.table-action-btn--edit:hover { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.table-action-btn--delete:hover { background: rgba(239,68,68,0.1); border-color: var(--red); color: var(--red); }

/* Admin Media Grid */
.admin-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
.admin-media-item { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1/1; position: relative; cursor: pointer; }
.admin-media-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.admin-media-item:hover img { transform: scale(1.05); }
.admin-media-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; gap: 0.5rem; opacity: 0; transition: opacity var(--t); }
.admin-media-item:hover .admin-media-overlay { opacity: 1; }
.admin-media-action { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.9); color: #000; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; transition: background var(--t); }
.admin-media-action:hover { background: white; color: #000; }
.admin-media-action--delete { background: rgba(239,68,68,0.9); color: white; }
.admin-media-action--delete:hover { background: var(--red); color: white; }
.admin-media-name { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.75); color: white; font-size: 0.65rem; padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-video-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.admin-video-footer { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.875rem; }
.admin-video-name { font-size: 0.78rem; color: var(--text-sec); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-video-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Detail Header */
.detail-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--card); border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--border); }
.detail-header-info { display: flex; align-items: center; gap: 0.875rem; }
.detail-athlete-photo { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.detail-athlete-photo--placeholder { background: var(--bg-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-label-dark  { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-sec); margin-bottom: 0.35rem; }
.form-input-dark, .form-select-dark {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 0.7rem 0.875rem; font-size: 0.875rem; font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t); outline: none;
  color-scheme: dark; /* ให้ browser render native widget (date picker, calendar icon) เป็นสีสว่าง เข้ากับพื้นหลังมืด */
}
.form-input-dark::placeholder { color: var(--text-muted); }
input[type="date"].form-input-dark { cursor: pointer; }
input[type="date"].form-input-dark::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.8; }
.form-input-dark:focus, .form-select-dark:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.form-input-dark.is-invalid, .form-input-dark.is-invalid:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.form-select-dark { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 12px; padding-right: 2rem; }
.field-error   { font-size: 0.78rem; color: #f87171; margin-top: 0.25rem; }
.form-footer   { display: flex; justify-content: flex-end; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Upload Zone */
.upload-zone {
  display: block; /* รองรับกรณีใช้ <label> เป็น element */
  border: 2px dashed var(--border-light); border-radius: var(--radius-md);
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--gold); background: var(--gold-dim); }
.upload-zone--sm { padding: 1.25rem 1rem; }
.upload-zone--video { border-color: rgba(248,40,133,0.35); }
.upload-zone--video:hover, .upload-zone--video.dragging { border-color: var(--blue); background: var(--blue-dim); }
/* ซ่อน file input — triggered ผ่าน <label> wrapper (cross-browser safe) */
.upload-zone-input { display: none; }
.upload-zone-icon { font-size: 2rem; color: var(--text-muted); display: block; margin-bottom: 0.5rem; }
.upload-zone-text { font-size: 0.875rem; font-weight: 500; color: var(--text-sec); }
.upload-zone-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.upload-preview img { max-height: 80px; border-radius: var(--radius-xs); margin: 0.5rem auto 0; }
.current-logo img { max-height: 50px; border-radius: var(--radius-xs); }
.current-athlete-photo { width: 90px; height: 90px; border-radius: var(--radius-md); object-fit: cover; margin: 0 auto; }

/* Radio & Handedness */
.radio-card { display: flex; align-items: center; cursor: pointer; }
.radio-card input { display: none; }
.radio-card input:checked + .radio-card-label { border-color: var(--gold); background: var(--gold-dim); }
.radio-card-label { padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--t); }
.radio-inline { display: flex; align-items: center; gap: 0.375rem; cursor: pointer; font-size: 0.875rem; color: var(--text-sec); }
.radio-inline input { accent-color: var(--gold); }
/* ── Position Picker (Admin Form) ─────────────────────── */
.position-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.position-toggle { cursor: pointer; user-select: none; }
.position-toggle input { display: none; }
.position-toggle span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 700; color: var(--text-muted);
  background: var(--card); transition: all var(--t); letter-spacing: 0.02em;
}
.position-toggle:hover span { border-color: var(--gold); color: var(--gold); }
.position-toggle input:checked + span {
  background: var(--gold); color: #000; border-color: var(--gold);
  box-shadow: 0 0 10px rgba(74,248,40,0.3);
}

/* ── Position Badges (Public Profile) ─────────────────── */
.position-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.position-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 0.2rem 0.6rem;
  background: var(--gold-dim); border: 1px solid var(--gold-mid);
  border-radius: var(--radius-xs); color: var(--gold);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
}

.handedness-radio-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.handedness-radio { display: flex; align-items: center; cursor: pointer; }
.handedness-radio input { display: none; }
.handedness-radio span {
  padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-sec); font-size: 0.875rem; cursor: pointer; transition: all var(--t);
}
.handedness-radio input:checked + span { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); font-weight: 600; }
.hand-option--left input:checked + span { border-color: var(--blue); background: var(--blue-dim); color: #fb5ca9; }
.hand-option--both input:checked + span { border-color: #a855f7; background: rgba(168,85,247,0.12); color: #c084fc; }

/* Buttons */
.btn-primary-dark {
  display: inline-flex; align-items: center; background: var(--gold); color: #000;
  font-weight: 600; font-size: 0.875rem; padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: background var(--t), transform var(--t); font-family: inherit;
  white-space: nowrap;
}
.btn-primary-dark:hover { background: #6ffb4a; color: #000; transform: translateY(-1px); }
.btn-sm-dark { padding: 0.45rem 0.875rem; font-size: 0.8rem; }
.btn-outline-dark {
  display: inline-flex; align-items: center; background: transparent;
  color: var(--text-sec); font-weight: 500; font-size: 0.875rem;
  padding: 0.65rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); cursor: pointer; font-family: inherit;
  transition: all var(--t); white-space: nowrap;
}
.btn-outline-dark:hover { border-color: var(--gold); color: var(--gold); }
.back-btn { display: inline-flex; align-items: center; color: var(--text-sec); font-size: 0.85rem; transition: color var(--t); flex-shrink: 0; }
.back-btn:hover { color: var(--gold); }

/* Auth */
.auth-body { background: radial-gradient(ellipse at 50% 0%, rgba(74,248,40,0.08), transparent 60%), var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-wrap  { width: 100%; max-width: 420px; }
.auth-card  { background: var(--card); border-radius: var(--radius-xl); padding: 2.5rem 2rem; border: 1px solid var(--border); }
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand-icon { font-size: 3rem; color: var(--gold); display: block; margin-bottom: 0.5rem; }
.auth-brand-name { font-size: 1.75rem; font-weight: 800; color: var(--text); margin: 0; }
.auth-brand-sub  { color: var(--text-muted); font-size: 0.8rem; margin: 0.25rem 0 0; }
.auth-back-link  { text-align: center; margin-top: 1.25rem; font-size: 0.82rem; color: var(--text-muted); }
.auth-back-link a { color: var(--text-sec); transition: color var(--t); }
.auth-back-link a:hover { color: var(--gold); }

/* Input Icon Group */
.input-icon-group { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 0.875rem; color: var(--text-muted); pointer-events: none; font-size: 0.9rem; }
.form-input-dark { padding-left: 2.5rem; }
.input-icon-right { position: absolute; right: 0.875rem; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0; font-size: 0.9rem; transition: color var(--t); }
.input-icon-right:hover { color: var(--gold); }
.btn-pw-toggle { right: 0.875rem; }

/* Flash Messages */
.flash-success, .flash-error { padding: 0.875rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; }
.flash-success { background: rgba(74,248,40,0.08); border: 1px solid rgba(74,248,40,0.25); color: #4af828; }
.flash-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.flash-warning { background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.30); color: #fbbf24; }

/* ── Roster Filter Bar (Public) ────────────────────────── */
.roster-filter-bar {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
}
.roster-filter-bar form { gap: 0.75rem; }
.roster-filter-label {
  color: var(--text-sec); font-size: 0.85rem; white-space: nowrap; flex-shrink: 0;
}
.roster-pos-select { min-width: 180px; }
.roster-filter-clear {
  display: inline-flex; align-items: center;
  padding: 0.35rem 0.75rem; border-radius: var(--radius-xs);
  border: 1px solid var(--border); color: var(--text-sec);
  font-size: 0.8rem; text-decoration: none; transition: all var(--t);
  white-space: nowrap;
}
.roster-filter-clear:hover { border-color: var(--gold); color: var(--gold); }

/* ── Athlete Card Position Badges (Roster) ─────────────── */
.athlete-pos-badges {
  display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem;
}

/* Empty State */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state-icon { font-size: 3rem; color: var(--text-muted); display: block; margin-bottom: 0.75rem; }
.empty-state p { color: var(--text-sec); font-size: 0.9rem; margin: 0; }

/* Text Helpers */
.text-gold       { color: var(--gold); }
.text-muted-light{ color: var(--text-sec); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-toggle-btn { display: block; }
  .hero-section { padding: 2.5rem 0 2rem; }
  .image-gallery { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .profile-hero { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .skill-tab-btn { font-size: 0.78rem; padding: 0.5rem 0.75rem; }
  .form-footer { flex-direction: column; }
  .form-footer .btn-primary-dark, .form-footer .btn-outline-dark { width: 100%; justify-content: center; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
