/* =========================================================
   Auction App – Global Styles
   ========================================================= */

:root {
  --primary:    #6c63ff;
  --primary-dark: #4e46d6;
  --accent:     #ff6584;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --info:       #3b82f6;
  --bg:         #0f0f1a;
  --bg2:        #16162a;
  --bg3:        #1e1e35;
  --card:       #1e1e35;
  --card2:      #252540;
  --border:     #2e2e50;
  --text:       #e8e8f0;
  --text2:      #9999bb;
  --text3:      #6666aa;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
  --timer-green: #22c55e;
  --timer-yellow: #f59e0b;
  --timer-red:   #ef4444;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1rem; }
p  { color: var(--text2); }

/* ---- Layout utilities ---- */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.card-sm { padding: 0.75rem 1rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16a34a; }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning  { background: var(--warning); color: #000; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }

.btn-lg { padding: 0.8rem 1.8rem; font-size: 1.05rem; }
.btn-xl { padding: 1rem 2.2rem; font-size: 1.15rem; border-radius: var(--radius); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; width: 2.1rem; height: 2.1rem; }

/* ---- Inputs ---- */
.input, .select, .textarea {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  transition: border-color var(--transition);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.input::placeholder { color: var(--text3); }
.input-group { display: flex; flex-direction: column; gap: 0.35rem; }
.input-group label { font-size: 0.82rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-primary { background: rgba(108,99,255,0.2); color: var(--primary); }
.badge-success { background: rgba(34,197,94,0.2);  color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.2); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,0.2);  color: var(--danger); }
.badge-neutral { background: rgba(255,255,255,0.08); color: var(--text2); }

/* ---- Dividers ---- */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Toast notifications ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 340px;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.87rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: slideIn 0.3s ease;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info    { border-left: 3px solid var(--info); }
.toast i { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.toast-success i { color: var(--success); }
.toast-error   i { color: var(--danger); }
.toast-warning i { color: var(--warning); }
.toast-info    i { color: var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ---- Modal overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; } to { opacity: 1; }
}
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.25s ease;
}
@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---- Nav ---- */
.nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.nav-logo span { color: var(--primary); }

/* ---- Status dot ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--text3); }
.status-dot.active  { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px var(--warning); }
  50%       { box-shadow: 0 0 12px var(--warning); }
}

/* ---- Bid history ---- */
.bid-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 260px; overflow-y: auto; }
.bid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 0.85rem;
  animation: slideIn 0.2s ease;
}
.bid-item .bid-team { font-weight: 600; }
.bid-item .bid-amount { color: var(--success); font-weight: 700; }
.bid-item .bid-time { color: var(--text3); font-size: 0.75rem; }

/* ---- Timer ring ---- */
.timer-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}
.timer-svg { transform: rotate(-90deg); width: 120px; height: 120px; }
.timer-bg { fill: none; stroke: var(--bg3); stroke-width: 8; }
.timer-ring {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}
.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
}

/* ---- Team cards in live room ---- */
.team-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}
.team-row.leading {
  border-color: var(--success);
  background: rgba(34,197,94,0.07);
}
.team-row.my-team {
  border-color: var(--primary);
  background: rgba(108,99,255,0.07);
}
.team-row.full-roster { opacity: 0.6; }
.team-name { font-weight: 700; font-size: 0.9rem; flex: 1; }
.team-budget { color: var(--success); font-weight: 700; font-size: 0.85rem; }
.team-roster { color: var(--text2); font-size: 0.78rem; }

/* ---- Player card in auction ---- */
.player-auction-card {
  background: linear-gradient(135deg, var(--card2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.player-auction-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}
.player-auction-name { font-size: 1.5rem; font-weight: 800; }
.player-auction-pos  { color: var(--text2); font-size: 0.85rem; }
.current-bid-display {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--success);
  margin: 0.5rem 0;
  font-variant-numeric: tabular-nums;
}
.leading-team-display {
  color: var(--text2);
  font-size: 0.9rem;
}
.leading-team-display strong { color: var(--warning); }

/* ---- Bid buttons ---- */
.bid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.bid-custom-row { display: flex; gap: 0.5rem; }
.bid-custom-row .input { flex: 1; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.data-table th {
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid rgba(46,46,80,0.5);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ---- Loading spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Alerts ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.3);  color: #93c5fd; }
.alert-success { background: rgba(34,197,94,0.1);   border: 1px solid rgba(34,197,94,0.3);   color: #86efac; }
.alert-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.3);  color: #fcd34d; }
.alert-danger  { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.3);   color: #fca5a5; }

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ---- Stat box ---- */
.stat-box {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-label { font-size: 0.75rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-sub   { font-size: 0.78rem; color: var(--text2); }

/* ---- Pill ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
}

/* ---- Landing page ---- */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at top, rgba(108,99,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at bottom, rgba(255,101,132,0.08) 0%, transparent 60%);
}
.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
  width: 100%;
  max-width: 760px;
}
.landing-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.landing-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(108,99,255,0.2); }
.landing-card-icon { font-size: 2.5rem; }
.landing-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.landing-card-desc  { font-size: 0.85rem; color: var(--text2); text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .bid-buttons     { grid-template-columns: 1fr; }
  .nav { padding: 0.75rem 1rem; }
  .card { padding: 1rem; }
  .modal { padding: 1.25rem; }
  .timer-container { width: 90px; height: 90px; }
  .timer-svg { width: 90px; height: 90px; }
  .timer-text { font-size: 1.4rem; }
  .current-bid-display { font-size: 2rem; }
}

@media (max-width: 480px) {
  .landing-cards { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
}
