/* =========================================================
   USOP Follow Player (Standalone)
   - No Webflow dependencies
   - Mobile-first, dark-mode, brand colors
   ========================================================= */

:root{
  --brand-navy: #0B2A5B;
  --brand-red:  #C8102E;
  --brand-gold: #FDB913;

  /* Webflow-like action colors */
  --follow-blue: #1F5FFF;     /* Follow */
  --follow-blue-hover: #184AD0;

  --following-green: #1FBF63; /* Following */
  --following-green-hover: #16944A;

  --bg: #F6F7FB;
  --card: #FFFFFF;
  --text: #121826;
  --muted: #5D677A;
  --border: rgba(17, 24, 39, 0.12);
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.10);

  --btn: rgba(11, 42, 91, 0.10);
  --btnText: var(--brand-navy);
  --btnHover: rgba(11, 42, 91, 0.14);

  --primaryBg: var(--brand-navy);
  --primaryText: #FFFFFF;

  --secondaryBg: rgba(200, 16, 46, 0.10);
  --secondaryText: #7C0014;
  --secondaryHover: rgba(200, 16, 46, 0.14);

  --focus: 0 0 0 3px rgba(253, 185, 19, 0.35);

  --radius: 16px;
  --radiusSm: 12px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0B1220;
    --card: #0F1B2E;
    --text: #E8EDF7;
    --muted: #B3C0D9;
    --border: rgba(232, 237, 247, 0.14);
    --shadow: 0 12px 30px rgba(0,0,0,0.40);

    --btn: rgba(253, 185, 19, 0.14);
    --btnText: #F7D77B;
    --btnHover: rgba(253, 185, 19, 0.18);

    --secondaryBg: rgba(200, 16, 46, 0.18);
    --secondaryText: #FFD0D7;
    --secondaryHover: rgba(200, 16, 46, 0.24);
  }
}
html[data-theme="dark"]{
  --bg: #0B1220;
  --card: #0F1B2E;
  --text: #E8EDF7;
  --muted: #B3C0D9;
  --border: rgba(232, 237, 247, 0.14);
  --shadow: 0 12px 30px rgba(0,0,0,0.40);

  --btn: rgba(253, 185, 19, 0.14);
  --btnText: #F7D77B;
  --btnHover: rgba(253, 185, 19, 0.18);

  --secondaryBg: rgba(200, 16, 46, 0.18);
  --secondaryText: #FFD0D7;
  --secondaryHover: rgba(200, 16, 46, 0.24);
}

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

.brand-title {
  text-align: center;
}

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
html, body { height: 100%; }
body { overflow-y: auto; -webkit-overflow-scrolling: touch; }

button, input{ font: inherit; }

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

.page{ min-height: 100vh; }

.container{
  width: min(980px, calc(100vw - 24px));
  margin: 0 auto;
}

/* Top bar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(90deg, var(--brand-navy), #0E3A7D);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.topbar-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 35% 35%, var(--brand-gold), transparent 50%),
    linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0));
  border: 1px solid rgba(255,255,255,0.25);
}
.brand-title{
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 14px;
  line-height: 1.1;
}
.brand-subtitle{
  opacity: 0.9;
  font-size: 13px;
  line-height: 1.1;
}

/* Icon button */
.icon-btn{
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}
.icon-btn:hover{ background: rgba(255,255,255,0.18); }
.icon-btn:focus{ outline: none; box-shadow: 0 0 0 3px rgba(253,185,19,0.35); }
.icon{ font-size: 18px; }

/* Banner */
.banner{
  margin: 14px 0;
  padding: 12px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: rgba(253,185,19,0.12);
  color: var(--text);
}

/* Card */
.card{
  margin: 14px 0 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-row{
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-wrap{
  position: relative;
  flex: 1;
}

.search-input{
  width: 100%;
  padding: 12px 44px 12px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.search-input:focus{
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(253,185,19,0.55);
}

.search-clear{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  cursor: pointer;
  display: none;
}
html[data-theme="dark"] .search-clear{ background: rgba(0,0,0,0.25); }
.search-clear:hover{ filter: brightness(1.03); }
.search-clear:focus{ outline: none; box-shadow: var(--focus); }

.actions{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 750;
  background: var(--btn);
  color: var(--btnText);
}
.btn:hover{ background: var(--btnHover); }
.btn:focus{ outline: none; box-shadow: var(--focus); }
.btn:disabled{ opacity: 0.65; cursor: not-allowed; }

.btn-primary{
  background: var(--primaryBg);
  color: var(--primaryText);
  border-color: rgba(255,255,255,0.0);
}
.btn-primary:hover{ filter: brightness(1.03); }

/* Pause / Resume button states */

.pause-red {
  background: #f09f1d;   /* Webflow red */
  color: #fff;
}
.pause-red:hover {
  background: #b96e04;
}

.resume-green {
  background: #1FBF63;   /* Webflow green */
  color: #fff;
}
.resume-green:hover {
  background: #16944A;
}

.btn-secondary:hover{ background: var(--secondaryHover); }

.meta-row{
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.hint{
  color: var(--muted);
  font-size: 13px;
}

.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill-muted{ color: var(--muted); }
.pill-good{ background: rgba(46, 204, 113, 0.12); }
.pill-warn{ background: rgba(253, 185, 19, 0.14); }
.pill-bad{  background: rgba(200, 16, 46, 0.14); }

/* Skeleton */
.skeleton{
  display: none;
  margin: 8px 0 0;
}
.skeleton-item{
  height: 58px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.06),
    rgba(0,0,0,0.10),
    rgba(0,0,0,0.06)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
html[data-theme="dark"] .skeleton-item{
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.10),
    rgba(255,255,255,0.06)
  );
}
@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* Results */
.results{
  margin: 10px 0 30px;
}
.result-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  margin-bottom: 10px;
}
.player-name{
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}

/* --- Follow button colors (Webflow-like) --- */
.follow-button{
  border-radius: 999px;
  padding: 10px 14px;
  border: 0;
  background: var(--follow-blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.follow-button:hover{
  background: var(--follow-blue-hover);
}
.follow-button.following{
  background: var(--following-green);
  color: #fff;
}
.follow-button.following:hover{
  background: var(--following-green-hover);
}
.follow-button:disabled{
  opacity: 0.72;
  cursor: not-allowed;
}

.no-results{
  padding: 14px 12px;
  border-radius: var(--radiusSm);
  border: 1px dashed var(--border);
  color: var(--muted);
  background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .no-results{ background: rgba(0,0,0,0.20); }

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9999;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.modal-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.modal-card{
  position: relative;
  width: min(560px, calc(100vw - 24px));
  margin: 12px auto;
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-close{
  position: absolute;
  top: 8px;
  right: 10px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.modal-close:focus{ outline: none; box-shadow: var(--focus); }
.modal-title{ margin: 2px 0 6px; font-size: 18px; font-weight: 900; }
.modal-text{ margin: 0 0 12px; color: var(--muted); }
.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.field{
  width: 100%;
  padding: 12px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.field:focus{ outline: none; box-shadow: var(--focus); }

.note{ margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.error{ margin: 10px 0 0; color: var(--brand-red); font-weight: 700; }

@media (max-width: 520px){
  .search-row{ flex-direction: column; align-items: stretch; }
  .result-item{ align-items: flex-start; flex-direction: column; }
  .follow-button{ width: 100%; }
}
