/* public/assets/css/checkin.css - Athlete Check-in Portal Styles */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700;800&family=Be+Vietnam+Pro:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
  --ci-bg: #090d16;
  --ci-card-bg: #111827;
  --ci-card-border: #1f2937;
  --ci-card-hover: #1e293b;
  --ci-header-bg: rgba(17, 24, 39, 0.92);
  --ci-header-border: #1f2937;
  --ci-primary: #0ea5e9;
  --ci-success: #10b981;
  --ci-success-glow: rgba(16, 185, 129, 0.4);
  --ci-warning: #f59e0b;
  --ci-danger: #ef4444;
  --ci-text: #f9fafb;
  --ci-text-muted: #9ca3af;
  --ci-font: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ci-mono: 'Chakra Petch', monospace;
}

[data-theme="light"] {
  --ci-bg: #f8fafc;
  --ci-card-bg: #ffffff;
  --ci-card-border: #e2e8f0;
  --ci-card-hover: #f1f5f9;
  --ci-header-bg: rgba(255, 255, 255, 0.92);
  --ci-header-border: #e2e8f0;
  --ci-primary: #0284c7;
  --ci-success: #10b981;
  --ci-success-glow: rgba(16, 185, 129, 0.2);
  --ci-warning: #f59e0b;
  --ci-danger: #ef4444;
  --ci-text: #0f172a;
  --ci-text-muted: #475569;
  --ci-font: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ci-mono: 'Chakra Petch', monospace;
}

body.checkin-body {
  background-color: var(--ci-bg);
  color: var(--ci-text);
  font-family: var(--ci-font);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Header Bar */
.checkin-header {
  background: var(--ci-header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ci-header-border);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.checkin-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checkin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.checkin-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.checkin-brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ci-text);
  margin: 0;
  line-height: 1.2;
}

.checkin-brand-text p {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2px 0 0 0;
}

/* Main Container */
.checkin-main {
  flex-grow: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 60px;
  box-sizing: border-box;
}

/* Hero Stats Card */
.checkin-hero-card {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.checkin-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.checkin-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.checkin-hero-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkin-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Counters Row */
.checkin-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.checkin-counter-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
}

.checkin-counter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.checkin-counter-num {
  font-size: 26px;
  font-weight: 900;
  font-family: var(--ci-mono);
  margin-top: 4px;
}

/* Progress Bar */
.checkin-progress-wrap {
  background: #0f172a;
  border-radius: 9999px;
  height: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.checkin-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* Sticky Search Container */
.checkin-search-sticky {
  position: sticky;
  top: 68px;
  z-index: 40;
  margin-bottom: 20px;
}

.checkin-search-wrap {
  background: var(--ci-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--ci-card-border);
  border-radius: 16px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.checkin-search-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25), 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.checkin-search-icon {
  font-size: 18px;
  color: #38bdf8;
}

.checkin-search-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ci-text);
}

.checkin-search-input::placeholder {
  color: var(--ci-text-muted);
  font-weight: 400;
}

.checkin-search-clear {
  background: rgba(125, 125, 125, 0.15);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  color: var(--ci-text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkin-search-clear:hover {
  background: rgba(125, 125, 125, 0.3);
  color: var(--ci-text);
}

/* Filter Badges / Pills */
.checkin-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.checkin-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.checkin-pill {
  background: var(--ci-card-bg);
  border: 1px solid var(--ci-card-border);
  color: var(--ci-text-muted);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.checkin-pill:hover {
  background: var(--ci-card-hover);
  color: var(--ci-text);
}

.checkin-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.5);
}

.checkin-status-filter {
  display: inline-flex;
  background: var(--ci-card-bg);
  border: 1px solid var(--ci-card-border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.checkin-status-btn {
  background: transparent;
  border: none;
  color: var(--ci-text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkin-status-btn:hover {
  color: var(--ci-text);
}

.checkin-status-btn.active {
  background: var(--ci-card-hover);
  color: var(--ci-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Team Card Grid */
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Check-in Card */
.checkin-card {
  background: var(--ci-card-bg);
  border: 1px solid var(--ci-card-border);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.checkin-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.checkin-card.is-checked-in {
  border-color: rgba(16, 185, 129, 0.6);
  background: linear-gradient(135deg, var(--ci-card-bg) 0%, rgba(6, 78, 59, 0.15) 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.checkin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.checkin-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.checkin-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkin-badge-cat {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.checkin-badge-seed {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.checkin-badge-group {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.checkin-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ci-text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.checkin-card-club {
  font-size: 13px;
  color: var(--ci-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* Player Details */
.checkin-players-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--ci-card-hover);
  border: 1px solid var(--ci-card-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.checkin-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.checkin-player-name {
  font-weight: 700;
  color: var(--ci-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkin-player-phone {
  font-family: var(--ci-mono);
  font-size: 12px;
  color: #38bdf8;
  text-decoration: none;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.checkin-player-phone:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Check-in Status Banner inside Card */
.checkin-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
  gap: 10px;
}

.checkin-status-indicator {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkin-status-text {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkin-status-text.checked-in {
  color: #10b981;
}

.checkin-status-text.pending {
  color: #f59e0b;
}

.checkin-timestamp {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--ci-mono);
}

/* Action Button */
.btn-checkin-action {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-checkin-do {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.btn-checkin-do:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.btn-checkin-undo {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 14px;
  font-size: 12px;
}

.btn-checkin-undo:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* Doubles Sub-toggles */
.checkin-subtoggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checkin-subtoggle-btn.is-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
}

/* Empty State */
.checkin-empty {
  background: #111827;
  border: 1px dashed #334155;
  border-radius: 16px;
  padding: 48px 20px;
  text-align: center;
  color: #94a3b8;
  grid-column: 1 / -1;
}

.checkin-empty i {
  font-size: 42px;
  color: #38bdf8;
  margin-bottom: 12px;
}

/* Pulse animation */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulse-green 2s infinite;
}

@media (max-width: 640px) {
  .checkin-grid {
    grid-template-columns: 1fr;
  }
  .checkin-hero-card {
    padding: 16px;
  }
  .checkin-counter-num {
    font-size: 22px;
  }
  .checkin-search-sticky {
    top: 60px;
  }
}

/* Light Theme Overrides */
[data-theme="light"] .checkin-hero-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .checkin-hero-title {
  color: #0f172a;
}

[data-theme="light"] .checkin-hero-meta {
  color: #475569;
}

[data-theme="light"] .checkin-counter-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .checkin-counter-label {
  color: #475569;
}

[data-theme="light"] .checkin-counter-num {
  color: #0f172a;
}

[data-theme="light"] .checkin-progress-wrap {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .checkin-card.is-checked-in {
  background: #f0fdf4;
  border-color: #86efac;
}

[data-theme="light"] .checkin-players-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .checkin-card-status {
  border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .checkin-empty h3 {
  color: #0f172a !important;
}

[data-theme="light"] .checkin-empty p {
  color: #475569 !important;
}
