/* ================================================
   LOOMS HACKATHON — Global Styles
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg:        #0d0d1a;
  --bg2:       #12122a;
  --card:      #1a1a38;
  --card2:     #1f1f40;
  --border:    #2a2a55;
  --purple:    #7c3aed;
  --purple2:   #9d5cf6;
  --pink:      #ec4899;
  --text:      #e2e8f0;
  --muted:     #8892a4;
  --success:   #22c55e;
  --error:     #ef4444;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(124,58,237,.15);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
}

*, *::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;
  overflow-x: hidden;
}

/* ── Orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: .45;
}
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, #7c3aed, transparent 70%); top: -180px; left: -160px; }
.orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, #ec4899, transparent 70%); bottom: -160px; right: -120px; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, #3b82f6, transparent 70%); top: 40%; left: 60%; }

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2.5rem;
  background: rgba(13,13,26,.7);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fff;
  text-decoration: none;
}
.nav-admin {
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: .4rem .9rem;
  border: 1px solid var(--border);
  border-radius: 30px;
  transition: all .2s;
}
.nav-admin:hover { color: #fff; border-color: var(--purple); }

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--purple2), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: .4rem 1rem;
  background: rgba(124,58,237,.18);
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 30px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--purple2);
  letter-spacing: .5px;
  margin-bottom: 1.4rem;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 24px rgba(124,58,237,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(124,58,237,.55); }
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; justify-content: center; border-radius: var(--radius); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.8rem;
  background: transparent;
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--purple); color: var(--purple2); }

/* ── Alerts ── */
.alert {
  padding: .85rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #86efac; }

/* ════════════════════════════════════════
   HERO (index.html)
   ════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 7rem 2rem 4rem;
  text-align: center;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 1.4rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.stats-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.5rem;
  margin-top: 4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.stat-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  backdrop-filter: blur(12px);
  transition: transform .2s, border-color .2s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--purple); }
.stat-number { font-size: 2.4rem; font-weight: 900; color: #fff; }
.stat-label  { font-size: .8rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .8px; }

/* ════════════════════════════════════════
   FORM PAGE (register.html)
   ════════════════════════════════════════ */
.form-page { background: var(--bg); }

.form-container {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.form-header h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; }
.form-header p  { color: var(--muted); margin-top: .6rem; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.card:focus-within { border-color: var(--purple); }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-icon { font-size: 1.2rem; }

/* Fields */
.field-group { margin-bottom: 1.3rem; }
.field-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .5rem;
  letter-spacing: .2px;
}
.req { color: var(--pink); }

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  padding: .75rem 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}
input::placeholder, textarea::placeholder { color: #4a4a6a; }
textarea { resize: vertical; min-height: 130px; }

.field-hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* Member stepper */
.member-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .5rem;
}
.stepper-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover:not(:disabled) { border-color: var(--purple); background: rgba(124,58,237,.15); }
.stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.member-count { font-size: 1.6rem; font-weight: 800; min-width: 2rem; text-align: center; }

/* Member blocks */
.member-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.4rem;
  margin-bottom: 1rem;
  transition: border-color .2s;
}
.member-block:focus-within { border-color: rgba(124,58,237,.5); }
.member-label {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  color: var(--purple2);
}
.member-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
}
.member-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .member-fields { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════
   SUCCESS PAGE
   ════════════════════════════════════════ */
.success-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}
.success-icon  { font-size: 5rem; margin-bottom: 1rem; animation: bounce .7s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }
.success-container h1 { font-size: 3rem; font-weight: 900; letter-spacing: -1.5px; }
.success-team  { font-size: 1.2rem; color: var(--muted); margin: .8rem 0 .5rem; }
.success-sub   { color: var(--muted); max-width: 440px; line-height: 1.7; }
.success-actions { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; justify-content: center; }

/* ════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════ */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.8rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-icon { font-size: 3rem; margin-bottom: .8rem; }
.login-card h1 { font-size: 2rem; font-weight: 800; margin-bottom: .4rem; letter-spacing: -.5px; }
.login-card > p { color: var(--muted); margin-bottom: 2rem; font-size: .9rem; }
.login-card .field-group { text-align: left; }

/* ════════════════════════════════════════
   ADMIN DASHBOARD
   ════════════════════════════════════════ */
.admin-page {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.2rem;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
}
.sidebar-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2.5rem;
  padding: 0 .4rem;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(124,58,237,.15);
  color: var(--purple2);
}
.sidebar-link.download-btn {
  margin-top: .8rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-weight: 600;
}
.sidebar-link.download-btn:hover { opacity: .88; transform: translateX(2px); }
.sidebar-logout {
  display: block;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.sidebar-logout:hover { color: var(--error); }

/* Main area */
.admin-main {
  margin-left: 240px;
  flex: 1;
  padding: 2.5rem;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.admin-title { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; }
.admin-sub   { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

/* Admin stats */
.admin-stats {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  min-width: 130px;
  transition: border-color .2s;
}
.admin-stat-card:hover { border-color: var(--purple); }
.stat-num { font-size: 2rem; font-weight: 900; color: #fff; }
.stat-lbl { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 500; }

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1.1rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--purple); }
.search-bar svg { color: var(--muted); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  padding: 0;
}
.search-bar input::placeholder { color: #4a4a6a; }
.search-bar input:focus { box-shadow: none; }

/* Table */
.table-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}
.reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.reg-table thead tr {
  background: rgba(124,58,237,.15);
  border-bottom: 1px solid var(--border);
}
.reg-table th {
  padding: 1rem 1.2rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  white-space: nowrap;
}
.reg-table td { padding: 1rem 1.2rem; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.04); }
.reg-row:last-child td { border-bottom: none; }
.reg-row:hover { background: rgba(124,58,237,.06); }

.td-id { font-size: .8rem; color: var(--muted); text-align: center; }
.td-count { text-align: center; }

.team-badge {
  display: inline-block;
  padding: .35rem .85rem;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 30px;
  font-weight: 600;
  font-size: .85rem;
  color: var(--purple2);
  white-space: nowrap;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
}

/* Member chips */
.member-chip {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .5rem;
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.chip-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
}
.chip-info { display: flex; flex-direction: column; gap: .1rem; }
.chip-name { font-weight: 600; font-size: .82rem; color: var(--text); }
.chip-meta { font-size: .75rem; color: var(--muted); }
.chip-pin  { font-size: .72rem; color: var(--purple2); font-weight: 500; }

/* Problem text expand */
.td-problem { max-width: 300px; }
.problem-text {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
  transition: max-height .3s ease;
}
.problem-text.expanded { max-height: 1000px; }
.expand-btn {
  background: none;
  border: none;
  color: var(--purple2);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem 0;
  text-decoration: underline;
  margin-top: .3rem;
}
.expand-btn:hover { color: var(--pink); }

.td-date { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Delete button */
.btn-delete {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-delete:hover { background: rgba(239,68,68,.25); border-color: var(--error); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }

/* ── Responsive sidebar collapse ── */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; padding: 1rem .5rem; overflow: hidden; }
  .sidebar-logo, .sidebar-link span, .sidebar-logout { display: none; }
  .admin-main { margin-left: 60px; padding: 1.5rem 1rem; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .member-chip { flex-direction: column; }
}
