/* =========================================================
   LCStats.ie - styles

   Tweak site-level settings in: /site.config.json
   ========================================================= */

:root {
  --bg: #f7f8ff;
  --bg-accent: #eef2ff;
  --surface: #ffffff;
  --surface-soft: rgba(255,255,255,0.75);

  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.64);
  --border: rgba(15, 23, 42, 0.10);

  --accent: #2563eb;
  --accent-2: #7c3aed;

  --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.10);

  --max-width: 1120px;
  --header-height: 68px;

  --radius: 18px;
  --radius-sm: 14px;

  --ad-min-height: 90px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(124,58,237,0.10), rgba(255,255,255,0)),
    radial-gradient(900px 500px at 85% 0%, rgba(37,99,235,0.10), rgba(255,255,255,0)),
    linear-gradient(180deg, var(--bg) 0%, #ffffff 55%, #ffffff 100%);
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------------------------
   Header
   ------------------------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #0b1020, #111a33 50%, #0b1020);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
}

header .header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(124,58,237,0.95));
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.26);
}

.brand .name {
  font-weight: 850;
  letter-spacing: 0.2px;
  white-space: nowrap;
  font-size: 15px;
}

.brand .tagline {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

nav.site-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

nav.site-nav a {
  color: rgba(255,255,255,0.90);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.00);
}

nav.site-nav a.active,
nav.site-nav a:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.16);
  text-decoration: none;
}

@media (max-width: 920px) {
  .brand .tagline { display: none; }
}

/* -------------------------
   Layout
   ------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.hero {
  margin: 10px 0 18px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(700px 260px at 20% 0%, rgba(124,58,237,0.14), rgba(255,255,255,0)),
    radial-gradient(700px 260px at 85% 0%, rgba(37,99,235,0.14), rgba(255,255,255,0)),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.3px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 14px 0;
}

.card h1, .card h2 {
  margin: 0 0 8px;
}

.card h1 {
  font-size: 20px;
  letter-spacing: -0.2px;
}

.card h2 {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 18px;
}

.grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Used by the CAO points planner section */
.planner-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; }
  .planner-grid { grid-template-columns: 1fr; }
}

/* -------------------------
   Controls
   ------------------------- */

.controls {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
}

.control-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 210px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.75));
}

legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.radio-group, .inline-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

label.option {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
}

label.option:hover {
  background: rgba(37,99,235,0.08);
}

input[type="range"] {
  width: 240px;
}

select, input[type="text"], input[type="number"] {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 14px;
  background: rgba(255,255,255,0.95);
}

button.btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.1px;
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

button.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: rgba(255,255,255,0.00);
}

button.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------------------------
   Subject multi-select
   ------------------------- */

.subject-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  min-height: 44px;
}

.subject-picker:focus-within {
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
}

.subject-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.20);
  background: rgba(37,99,235,0.10);
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
}

.chip.active {
  border-color: rgba(124,58,237,0.25);
  background: rgba(124,58,237,0.12);
}

.chip .chip-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  padding: 0 2px;
  color: rgba(15,23,42,0.65);
}

.chip .chip-remove:hover {
  color: rgba(15,23,42,0.90);
}

.subject-picker input#subject-search {
  border: 0;
  outline: none;
  background: transparent;
  padding: 8px 6px;
  min-width: 160px;
  flex: 1;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  cursor: pointer;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.icon-btn:hover {
  background: rgba(37,99,235,0.08);
}

.subject-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  z-index: 60;
}

.subject-dropdown.hidden {
  display: none;
}

.subject-dropdown .dropdown-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}

.subject-dropdown .dropdown-item:hover,
.subject-dropdown .dropdown-item[aria-selected="true"] {
  background: rgba(37,99,235,0.08);
}

/* -------------------------
   Chart + summary
   ------------------------- */

.chart {
  width: 100%;
  min-height: 430px;
}

.summary {
  display: grid;
  gap: 10px;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
}

.kpi .label {
  font-size: 12px;
  color: var(--muted);
}

.kpi .value {
  font-size: 18px;
  font-weight: 900;
  margin-top: 4px;
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* -------------------------
   Data table
   ------------------------- */

details.data-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.70);
  padding: 8px 12px;
}

details.data-details summary {
  cursor: pointer;
  font-weight: 750;
}

.data-table-wrap {
  padding-top: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  font-size: 14px;
}

.data-table thead th {
  font-size: 12px;
  color: rgba(15,23,42,0.70);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(37,99,235,0.06);
}

/* -------------------------
   Footer
   ------------------------- */

footer.site-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* -------------------------
   Ads
   ------------------------- */

.ad-slot {
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.70);
  min-height: var(--ad-min-height);
  display: grid;
  place-items: center;
  color: rgba(15,23,42,0.45);
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}

.ad-slot[data-ad-state="hidden"] {
  display: none;
}

/* -------------------------
   Cookie banner
   ------------------------- */

.cookie-banner {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 100;
  background: rgba(11,16,32,0.96);
  color: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 14px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.35);
}

.cookie-banner.hidden { display: none; }

.cookie-banner .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner p {
  margin: 0;
  max-width: 780px;
  font-size: 13px;
  color: rgba(255,255,255,0.86);
}

.cookie-banner .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-banner .actions button {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.cookie-banner .actions button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255,255,255,0.00);
}
