/* === modern.css — dark-first theme and components === */
:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #0e1217;
  --muted: #1a1f26;
  --text: #e6eaf0;
  --text-dim: #aab3c0;
  --primary: #6aa9ff;
  --primary-600: #4e8fe8;
  --accent: #9bffa8;
  --ring: #7bb3ff;
  --border: #232a33;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% -10%, #0d1117, var(--bg));
  color: var(--text);
  font: 500 16px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* Layout shells */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(120%) blur(10px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; max-width: 1100px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px;
}
.brand-badge {
  width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(180deg, var(--primary), var(--primary-600));
  box-shadow: var(--shadow);
}
.nav {
  display: flex; gap: 10px; align-items: center;
}
.nav a {
  text-decoration: none; color: var(--text-dim);
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.nav a:hover { color: var(--text); background: var(--muted); border-color: var(--border); }

/* Surfaces */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Cards */
.card {
  padding: 18px 20px; border-radius: var(--radius);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1a2330, #111826);
  color: var(--text);
  padding: 10px 14px;
  transition: transform .1s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  cursor: pointer; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.btn.primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #0b1020; border-color: transparent;
}
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--muted); color: var(--text); }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  background: #0e131a; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent);
}

/* Tables */
.table {
  width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2);
}
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table th { text-align: left; color: var(--text-dim); font-weight: 600; background: #121822; }

/* Utilities */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.center { display: grid; place-items: center; }
.muted { color: var(--text-dim); }
.spacing-lg > * + * { margin-top: 16px; }

.footer {
  opacity: .9; color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: 40px; padding: 16px 24px; text-align: center;
}

/* Flexible action-row with consistent gaps and wrapping */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* If legacy inline buttons exist inside tables/forms, give them breathing room */
.table .btn + .btn { margin-left: 8px; }
.form-actions .btn + .btn { margin-left: 8px; }

/* Harmonize Bootstrap's .navbar-dark with our theme */
.navbar.bg-dark {
  background-color: #0e131a !important;
  border-bottom: 1px solid var(--border);
}

/* Ensure dark text/links read well */
.navbar .nav-link { color: var(--text-dim) !important; }
.navbar .nav-link:hover { color: var(--text) !important; }

/* ---------- Global dark background + transparent wrappers ---------- */
:root{
  --bg:#0b0d10;          /* page background */
  --panel:#12151a;       /* card / surface */
  --panel-2:#0e1217;
  --border:#232a33;
  --text:#e6eaf0;
  --text-dim:#aab3c0;
}

/* Always keep the page itself dark */
html, body {
  background: var(--bg) !important;
  min-height: 100%;
}

/* The main app area */
main {
  background: transparent !important;
}

/* Make Bootstrap layout wrappers transparent globally */
.container,
.container-fluid,
.row,
[class^="col-"],
[class*=" col-"] {
  background: transparent !important;
}

/* Kill common “light” utilities that may sneak in */
.bg-light, .bg-white, .jumbotron, .card.bg-light, .card.bg-white {
  background-color: transparent !important;
}

/* If your legacy style.css sets container backgrounds, neutralize it here */
.container {
  box-shadow: none !important;   /* just in case */
  border: 0 !important;
}

/* Your surfaces/components should supply their own backgrounds */
.kcard, .entry-card, .kevent-card, .card.kcard-like {
  background: linear-gradient(180deg, var(--panel), var(--panel-2)) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

/* Keep the sticky navbar clickable (you already have this in layout) */
.navbar { position: sticky; top: 0; z-index: 9999 !important; }

/* ==== Global dark baseline (refined) ==== */
:root{
  --bg:#0b0d10;
  --panel:#12151a;
  --panel-2:#0e1217;
  --section:#11161c;      /* NEW: section surface, darker than cards */
  --border:#232a33;
  --text:#e6eaf0;
  --text-dim:#aab3c0;
  --radius:14px;
  --shadow:0 8px 28px rgba(0,0,0,.45);
}

html, body{
  background: var(--bg) !important;
  min-height: 100%;
}

/* Keep the main app area neutral; don’t force rows/cols to be transparent */
main{ background: transparent !important; }

/* Legacy styles sometimes painted .container; keep it neutral but comfy */
main .container{
  background: transparent !important;
  padding-left: 24px;
  padding-right: 24px;
}
@media (min-width: 768px){
  main .container{ padding-left: 32px; padding-right: 32px; }
}

/* ===== Section surface (wrap logical groups) =====
   Use when you have a heading like “Active Events” or “Actions”. */
.ksection{
  background: linear-gradient(180deg, var(--section), #0d1218);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(255,255,255,.02), var(--shadow);
  padding: 18px 20px;
  margin: 18px 0 22px;
}

/* Headings breathe instead of hugging edges */
.ksection > h2,
.ksection > h3{
  margin: 0 0 12px 0;
}

/* ===== Cards stay distinct from sections ===== */
.kevent-card,
.entry-card,
.kcard{
  background: linear-gradient(180deg, var(--panel), var(--panel-2)) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  padding: 16px !important;
}

/* Tidy default h1 spacing sitewide */
h1{ margin: 8px 0 10px; }

/* Links readable on dark bg */
a{ color: #7bb3ff; }
a:hover{ color: #a8c9ff; text-decoration: none; }

/* Optional: give wide sections a bit more room vertically on large screens */
@media (min-width: 992px){
  .ksection{ padding: 20px 24px; }
}
