/* Hackathon Hub — light theme styled after the AWS Console (Cloudscape) */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f7f8f8;
  --border: #d5dbdb;
  --border-soft: #e9ebed;
  --text: #16191f;
  --muted: #5f6b7a;
  --accent: #0972d3;        /* AWS console blue */
  --accent-dark: #075aa8;
  --accent-2: #ec7211;      /* AWS orange */
  --accent-3: #037f0c;      /* success green */
  --header: #0f1b2a;        /* squid-ink top nav */
  --header-2: #232f3e;
  --ok: #037f0c;
  --err: #d91515;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(0, 28, 68, 0.08), 0 4px 14px rgba(0, 28, 68, 0.06);
  --gradient: linear-gradient(120deg, #0972d3, #075aa8);
}

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

html { color-scheme: light; }

body {
  font-family: "Open Sans", "Amazon Ember", "Helvetica Neue", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

/* soft ambient gradient behind everything */
.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(45% 42% at 88% 6%, rgba(122, 132, 248, 0.10) 0%, transparent 70%),
    radial-gradient(50% 46% at 6% 94%, rgba(236, 114, 17, 0.09) 0%, transparent 70%),
    radial-gradient(42% 40% at 92% 94%, rgba(236, 150, 180, 0.10) 0%, transparent 70%);
}

/* app shell: fixed sidebar + scrolling content */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; }
.shell { max-width: 1100px; margin: 0 auto; padding: 26px 26px 90px; }

.sidebar {
  width: 248px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid rgba(15, 27, 42, 0.06);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand .logo { height: 34px; display: grid; place-items: center; }
.brand .logo img { height: 100%; width: auto; display: block; }
.brand h1 { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text); line-height: 1.25; }
.brand small {
  display: block; font-weight: 700; font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: linear-gradient(90deg, #0a8ba0, #0972d3 55%, #ec7211);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-size: 0.88rem; font-weight: 600;
  padding: 10px 13px; border-radius: 12px; cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nav .ni { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.75); }
.nav button.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 27, 42, 0.08), 0 1px 2px rgba(15, 27, 42, 0.05);
}
/* small accent tick on the active item */
.nav button.active::before {
  content: "";
  width: 3px; height: 16px; border-radius: 2px; margin-left: -6px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.sidebar-bottom {
  margin-top: auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px;
}
.sidebar-bottom:empty { background: transparent; border-color: transparent; padding: 0; }

/* sections */
.view { display: none; animation: rise 0.35s ease-out; }
.view.active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hero { padding: 8px 0 6px; }
.hero h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.hero h2 .grad { color: var(--accent-2); }
.hero p { color: var(--muted); margin-top: 6px; max-width: 680px; font-size: 0.95rem; }

.grid { display: grid; gap: 18px; margin-top: 22px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border); }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.card h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.card .sub { color: var(--muted); font-size: 0.85rem; margin: -8px 0 14px; }

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field span, .field-label { display: block; font-size: 0.76rem; font-weight: 700; color: #414d5c; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #7d8998;
  border-radius: 8px;
  color: var(--text);
  font: inherit; font-size: 0.92rem;
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.25);
}
input::placeholder, textarea::placeholder { color: #9ba7b6; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #414d5c;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.84rem; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on {
  background: #f2f8fd;
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.btn {
  border: 1px solid var(--accent);
  cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.9rem;
  padding: 9px 22px;
  border-radius: 20px;             /* Cloudscape pill buttons */
  color: #ffffff;
  background: var(--accent);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: #ffffff; border-color: var(--accent); color: var(--accent); }
.btn.ghost:hover { background: #f2f8fd; color: var(--accent-dark); }
.btn.small { padding: 5px 14px; font-size: 0.8rem; }
.btn.danger { background: #ffffff; border-color: var(--err); color: var(--err); }
.btn.danger:hover { background: #fff5f5; }

/* the sidebar hosts ghost buttons too — keep them neutral there */
.sidebar .btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.sidebar .btn.ghost:hover { border-color: var(--muted); background: var(--surface-2); }

/* lists, badges, tables */
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border-soft); color: #414d5c; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.tag.accent { background: #f2f8fd; border-color: #b5d6f4; color: var(--accent-dark); }
.tag.teal { background: #effff1; border-color: #a4d7a8; color: var(--accent-3); }
.tag.pink { background: #fef6f0; border-color: #f5c8a4; color: #b0570c; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.list-item:hover { border-color: var(--border); background: #fbfcfc; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; font-size: 0.92rem; }
.list-item .meta { color: var(--muted); font-size: 0.8rem; }

.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8rem; color: #fff;
  background: var(--header-2);
}
.sidebar .avatar { background: var(--accent-2); }
.sidebar #user-area { font-size: 0.86rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { text-align: left; color: #414d5c; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 9px 12px; border-bottom: 2px solid var(--border-soft); background: #fbfcfc; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f2f8fd; }
.table-wrap { overflow-x: auto; }

/* toggle switch */
.switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: #aab7b8;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(22px); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* podium */
.podium { display: flex; gap: 16px; align-items: flex-end; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.podium .place {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 26px;
  min-width: 170px;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease-out both;
}
.podium .place.p1 { border-color: #f0c243; box-shadow: 0 4px 18px rgba(236, 114, 17, 0.18); order: 2; padding-bottom: 42px; }
.podium .place.p2 { order: 1; padding-bottom: 30px; animation-delay: 0.08s; }
.podium .place.p3 { order: 3; animation-delay: 0.16s; }
.podium .medal { font-size: 2.2rem; }
.podium .team { font-weight: 700; margin-top: 6px; }

.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 0.9rem; }

.banner {
  border: 1px solid #f5c8a4;
  background: #fef6f0;
  color: #8a4b09;
  border-left: 4px solid var(--accent-2);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* toast */
#toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--header-2);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 28, 68, 0.28);
  transition: transform 0.3s ease;
  z-index: 50;
  max-width: min(90vw, 480px);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.ok { background: #effff1; border-color: #a4d7a8; color: var(--ok); }
#toast.err { background: #fff5f5; border-color: #f1aeae; color: var(--err); }

/* activity progress + gantt (admin report) */
.progressbar {
  height: 10px; border-radius: 5px; background: var(--surface-2);
  border: 1px solid var(--border-soft); overflow: hidden; margin-bottom: 16px;
}
.progressbar-fill { height: 100%; border-radius: 5px 0 0 5px; background: var(--accent); }
.gantt { display: flex; gap: 10px; margin-top: 6px; }
.gantt-labels { width: 200px; flex-shrink: 0; }
.gantt-label {
  height: 30px; display: flex; align-items: center;
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-tracks { position: relative; flex: 1; min-width: 0; }
.gantt-track { position: relative; height: 30px; border-bottom: 1px solid var(--border-soft); }
.gantt-track:last-of-type { border-bottom: 0; }
.gantt-bar {
  position: absolute; top: 8px; height: 14px; border-radius: 4px; overflow: hidden;
}
.gantt-fill { height: 100%; border-radius: 4px 0 0 4px; }
.gantt-today {
  position: absolute; top: -4px; bottom: 0; width: 2px;
  background: var(--accent-2); opacity: 0.85; pointer-events: none;
}
.gantt-today span {
  position: absolute; top: -14px; left: -16px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-2);
}
.gantt-axis {
  display: flex; justify-content: space-between; margin: 6px 0 0 210px;
  font-size: 0.72rem; color: var(--muted); font-weight: 600;
}
.gantt-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 14px; }
.gantt-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.gantt-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* login overlay (admin + participant) */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(15, 27, 42, 0.55);
  backdrop-filter: blur(3px);
}
.overlay .card { width: min(92vw, 380px); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #aab7b8; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* narrow screens: the sidebar becomes a top panel with a scrollable menu row */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px;
    border-right: 0; border-bottom: 1px solid rgba(15, 27, 42, 0.06);
    padding: 14px 16px;
  }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; flex: 1; min-width: 0; }
  .nav button { width: auto; white-space: nowrap; }
  .nav button.active::before { display: none; }
  .sidebar-bottom { margin-top: 0; margin-left: auto; }
  .shell { padding: 14px 14px 70px; }
}
