/* ──────────────────────────────────────────────────────────────────────────────
   iotaTONE — Main Stylesheet
   Brand: black bg, white panels, #5B4BE0 purple/indigo primary,
          #2563EB blue, #16A34A green, #EA580C orange, #DC2626 red accents
   ────────────────────────────────────────────────────────────────────────── */

/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0a0a;
  --surface:      #ffffff;
  --surface-alt:  #f5f5f7;
  --border:       #e0e0e0;
  --text:         #111111;
  --text-muted:   #666666;
  --primary:      #5B4BE0;
  --primary-dark: #4438c4;
  --blue:         #2563EB;
  --green:        #16A34A;
  --orange:       #EA580C;
  --red:          #DC2626;
  --header-bg:    #111111;
  --footer-bg:    #111111;
  --radius:       8px;
  --shadow:       0 2px 16px rgba(0,0,0,.12);
  --font-serif:   Georgia, 'Times New Roman', serif;
  --font-sans:    system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition:   180ms ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p  { margin-bottom: 1em; }

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-main {
  flex: 1;
  padding-block: 2.5rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin-inline: auto;
  padding: 0.875rem 1.25rem;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.logo-text span { color: var(--primary); }

.site-logo img { height: 40px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.site-nav a {
  color: #cccccc;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.site-nav a:hover { color: #ffffff; }

/* Banner area (homepage only) */
.header-banner { display: none; }
body.page-home .site-header { position: relative; }
body.page-home .header-banner {
  display: block;
  background: #0d0d0d;
  overflow: hidden;
}
body.page-home .banner-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: center;
}
body.page-home .banner-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #111 0%, #1a1060 50%, #111 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid #222;
  padding-block: 2rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}

.footer-logo-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.footer-tagline {
  color: #666;
  font-size: 0.8125rem;
  margin: 0;
  letter-spacing: 0.05em;
}

.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { color: #888; font-size: 0.875rem; }
.footer-nav a:hover { color: #fff; }

.footer-social { display: flex; gap: 0.75rem; }
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #888;
  transition: color var(--transition);
}
.social-icon:hover { color: #fff; }
.social-icon svg { width: 18px; height: 18px; }

.footer-copy {
  width: 100%;
  text-align: center;
  color: #555;
  font-size: 0.8125rem;
  margin: 0;
  border-top: 1px solid #222;
  padding-top: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1.0625rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Cards / Panels ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.card-sm { padding: 1.25rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,75,224,.15);
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid transparent;
}
.alert-error   { background: #fef2f2; color: #991b1b; border-color: var(--red); }
.alert-success { background: #f0fdf4; color: #166534; border-color: var(--green); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: var(--blue); }
.alert-warning { background: #fff7ed; color: #9a3412; border-color: var(--orange); }

/* ── Auth pages (login, register, etc.) ─────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-header {
  background: var(--header-bg);
  padding: 1.75rem 2rem;
  text-align: center;
  border-bottom: 3px solid var(--primary);
}

.auth-card-header h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.auth-card-header p {
  color: #888;
  font-size: 0.875rem;
  margin: 0;
}

.auth-card-body { padding: 2rem; }

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-links a { color: var(--primary); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-admin     { background: #ede9fe; color: #5B4BE0; }
.badge-moderator { background: #dbeafe; color: #1d4ed8; }
.badge-tester    { background: #dcfce7; color: #166534; }
.badge-user      { background: #f3f4f6; color: #374151; }
.badge-active    { background: #dcfce7; color: #166534; }
.badge-pending   { background: #fef9c3; color: #854d0e; }
.badge-suspended { background: #ffedd5; color: #9a3412; }
.badge-banned    { background: #fee2e2; color: #991b1b; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  transition: all var(--transition);
}

.pagination a:hover  { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #ccc; pointer-events: none; }

/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

.admin-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 0;
  position: sticky;
  top: 80px;
}

.admin-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.admin-sidebar a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: #f5f5f7;
  color: var(--primary);
  border-left-color: var(--primary);
}

.admin-content { min-width: 0; }

/* ── Accent bar ──────────────────────────────────────────────────────────── */
.accent-bar {
  height: 4px;
  background: linear-gradient(to right, var(--blue), var(--primary), var(--red), var(--orange), var(--green));
  border-radius: 4px 4px 0 0;
}

/* ── Hero (homepage) ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding-block: 4rem;
  color: #fff;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 0.75rem;
}

.hero h1 em {
  color: var(--primary);
  font-style: normal;
}

.hero .tagline {
  color: #888;
  font-size: 1.125rem;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.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;
}

/* ── Screenshot carousel ─────────────────────────────────────────────────── */
.screenshots {
  margin-top: 3rem;
  padding-bottom: 1rem;
}

.screenshots h2 {
  color: #fff;
  text-align: center;
  margin-bottom: 1.5rem;
}

.carousel {
  position: relative;
  overflow: hidden;
  max-width: 340px;
  margin-inline: auto;
}

.carousel-track {
  display: flex;
  transition: transform 350ms ease;
}

.carousel-slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  padding: 0 2.5rem;
}

.carousel-slide img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.carousel-btn:hover { background: rgba(255,255,255,.3); }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  padding: 0;
}
.carousel-dot.active { background: var(--primary); }

/* ── Footer Bond Institute logo ──────────────────────────────────────────── */
.footer-bi-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.footer-bi-logo img { height: 50px; width: auto; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid #222;
    z-index: 99;
  }
  .site-nav.open { display: flex; }
  .site-header { position: relative; }
  .nav-toggle { display: flex; }

  .admin-wrap {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-nav, .footer-social { justify-content: center; }
}

@media (max-width: 480px) {
  .auth-card-body { padding: 1.5rem; }
  .card { padding: 1.25rem; }
}
