/* ============================================================
   BOOM Personal Training Studio — app.css
   Tema: Turuncu + Siyah, Apple mobile-first
   ============================================================ */

/* ── Fonts & Reset ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap');

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

:root {
  --orange:       #F5A100;
  --orange-dark:  #D48800;
  --orange-light: #FFB733;
  --orange-soft:  rgba(245,161,0,.12);
  --black:        #0A0A0A;
  --surface:      #161616;
  --surface2:     #1F1F1F;
  --surface3:     #2A2A2A;
  --border:       rgba(255,255,255,.08);
  --border2:      rgba(255,255,255,.14);
  --text:         #F0F0F0;
  --text-muted:   #888;
  --text-dim:     #555;
  --red:          #FF453A;
  --green:        #30D158;
  --blue:         #0A84FF;
  --radius-sm:    10px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --font:         'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-light); }

img { max-width: 100%; display: block; }

/* ── Utility ────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--orange); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

/* ── Layout Shell ───────────────────────────────────────────── */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 calc(80px + var(--safe-bottom));
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: calc(var(--safe-top) + 14px) 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.app-header .logo {
  height: 32px;
  width: auto;
}

.app-header .page-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.3px;
}

.app-header .header-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background .15s;
}
.app-header .header-action:active { background: var(--surface3); }

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(22,22,22,.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  border: none;
  background: transparent;
}
.nav-item svg, .nav-item .nav-icon { font-size: 24px; }
.nav-item.active { color: var(--orange); }
.nav-item:active { opacity: .7; }

/* ── Page Content ───────────────────────────────────────────── */
.page { padding: 20px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.1;
  letter-spacing: -1px;
}
.stat-value.big { font-size: 36px; }
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); opacity: .85; }

.btn-primary {
  background: var(--orange);
  color: #000;
  width: 100%;
}
.btn-primary:hover { background: var(--orange-light); color: #000; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  width: 100%;
}

.btn-danger {
  background: rgba(255,69,58,.15);
  color: var(--red);
  border: 1px solid rgba(255,69,58,.3);
}

.btn-ghost {
  background: transparent;
  color: var(--orange);
  padding: 10px 16px;
}

.btn-sm {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  padding: 13px 16px;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
.form-control::placeholder { color: var(--text-dim); }
.form-control option { background: var(--surface2); }

.form-select { appearance: none; -webkit-appearance: none; padding-right: 40px; }
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  pointer-events: none;
}

/* ── List Items ─────────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.list-item:last-child { border-bottom: none; }
.list-item:active { opacity: .7; }

.list-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--orange-soft);
  border: 2px solid var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
  text-transform: uppercase;
}

.list-info { flex: 1; min-width: 0; }
.list-name  { font-size: 15px; font-weight: 600; }
.list-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-chevron { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }

/* ── Badges / Pills ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge-green  { background: rgba(48,209,88,.15); color: var(--green); }
.badge-red    { background: rgba(255,69,58,.15);  color: var(--red); }
.badge-orange { background: var(--orange-soft);   color: var(--orange); }
.badge-gray   { background: var(--surface3);       color: var(--text-muted); }
.badge-blue   { background: rgba(10,132,255,.15);  color: var(--blue); }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  background: var(--black);
}

.login-logo {
  height: 80px;
  margin-bottom: 8px;
}

.login-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 40px;
  text-align: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Alert / Toast ──────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(255,69,58,.12); border: 1px solid rgba(255,69,58,.3); color: #FF6B63; }
.alert-success { background: rgba(48,209,88,.12); border: 1px solid rgba(48,209,88,.3); color: var(--green); }
.alert-info    { background: rgba(245,161,0,.12); border: 1px solid rgba(245,161,0,.3); color: var(--orange); }

/* Toast overlay */
.toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.toast-overlay.show { opacity: 1; pointer-events: auto; }

.toast-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  transform: translateY(20px);
  transition: transform .3s;
}
.toast-overlay.show .toast-card { transform: translateY(0); }

.toast-emoji  { font-size: 56px; margin-bottom: 16px; }
.toast-title  { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin-bottom: 8px; }
.toast-sub    { font-size: 15px; color: var(--text-muted); line-height: 1.5; }

/* ── QR Scan Page ───────────────────────────────────────────── */
.scan-page {
  min-height: 100dvh;
  background: var(--black);
  display: flex;
  flex-direction: column;
}

.scan-header {
  padding: calc(var(--safe-top) + 16px) 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scan-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 24px;
}

.scan-frame {
  position: relative;
  width: 260px;
  height: 260px;
}

#qr-video {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.scan-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scan-corners::before,
.scan-corners::after,
.scan-corners span::before,
.scan-corners span::after {
  content: '';
  position: absolute;
  width: 30px; height: 30px;
  border-color: var(--orange);
  border-style: solid;
}
.scan-corners::before { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.scan-corners::after  { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.scan-corners span::before { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.scan-corners span::after  { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }

.scan-pulse {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  transform: translateY(-50%);
  animation: scan-line 2s ease-in-out infinite;
}
@keyframes scan-line {
  0%   { top: 10%; opacity: 1; }
  50%  { top: 90%; opacity: 1; }
  100% { top: 10%; opacity: 1; }
}

.scan-hint {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar {
  background: var(--surface3);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  transition: width .3s;
}

/* ── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title-lg {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
}

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 0 0 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--safe-bottom);
}
.modal-backdrop.open { display: flex; }

.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  padding: 12px 24px 32px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slide-up .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--surface3);
  border-radius: 100px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 20px;
}

/* ── Admin specific ─────────────────────────────────────────── */
.admin-shell { max-width: 800px; margin: 0 auto; }

.top-bar {
  background: rgba(10,10,10,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: calc(var(--safe-top) + 12px) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.sidebar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--orange-soft);
  color: var(--orange);
}

/* ── Search Bar ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}
.search-bar input {
  padding-left: 42px;
}
.search-bar .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 18px;
}

/* ── Checkin Feed ───────────────────────────────────────────── */
.feed-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.feed-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.feed-dot.in  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.feed-dot.out { background: var(--text-dim); }

/* ── Responsive: tablet ─────────────────────────────────────── */
@media (min-width: 600px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .app-shell, .admin-shell { padding-left: 20px; padding-right: 20px; }
}
