/* ===========================
   KNOWEASY GLOBAL STYLE.CSS
   Hybrid Theme · Dark Shell + Clean Cards
   Built for: Classes, Streams, Subjects, Chapters, AI Tools, Nova
   =========================== */

/* -------- CSS RESET -------- */

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

html,
body {
  height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

/* -------- DESIGN TOKENS -------- */

:root {
  --ke-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;

  --ke-bg-body: radial-gradient(circle at top, #020617 0%, #020617 40%, #000 100%);
  --ke-bg-elevated: #020617;
  --ke-bg-card: rgba(15, 23, 42, 0.98);
  --ke-bg-card-soft: #0f172a;
  --ke-bg-soft-light: #f7f9fc;

  --ke-border-subtle: rgba(148, 163, 184, 0.45);
  --ke-border-strong: rgba(148, 163, 184, 0.7);

  --ke-text-main: #e5edff;
  --ke-text-soft: #cbd5f5;
  --ke-text-muted: #94a3b8;
  --ke-text-onlight: #020617;

  --ke-accent: #38bdf8;
  --ke-accent-soft: rgba(56, 189, 248, 0.12);
  --ke-accent-strong: #0ea5e9;
  --ke-accent-purple: #a855f7;
  --ke-accent-orange: #f97316;

  --ke-radius-lg: 1.3rem;
  --ke-radius-md: 0.95rem;
  --ke-radius-pill: 999px;

  --ke-shadow-soft: 0 18px 34px rgba(15, 23, 42, 0.75);
  --ke-shadow-strong: 0 22px 48px rgba(15, 23, 42, 0.98);

  --ke-transition-fast: 150ms ease-out;
}

/* -------- GLOBAL LAYOUT -------- */

body {
  font-family: var(--ke-font-sans);
  background: var(--ke-bg-body);
  color: var(--ke-text-main);
}

/* For non-KE pages, general shell */
.page-shell,
.ke-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.4rem 1.1rem 3rem;
}

/* Default page wrapper if not using ke-page */
body:not(.ke-page) {
  background: var(--ke-bg-body);
}

/* -------- HEADER / NAV (generic + ke-header) -------- */

header,
.ke-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0 1.1rem;
}

header > a,
header nav > a {
  text-decoration: none;
}

.ke-header {
  position: relative;
  z-index: 10;
}

.ke-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ke-logo-orb {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: conic-gradient(from 210deg, #22d3ee, #a855f7, #f97316, #22d3ee);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.85);
}

.ke-logo-text {
  display: flex;
  flex-direction: column;
}

.ke-logo-main {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.96rem;
  text-transform: uppercase;
}

.ke-logo-tag {
  font-size: 0.74rem;
  color: var(--ke-text-muted);
}

.ke-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.ke-nav a {
  text-decoration: none;
  color: var(--ke-text-soft);
  opacity: 0.78;
  padding: 0.25rem 0.1rem;
  border-bottom: 1px solid transparent;
  transition: opacity var(--ke-transition-fast),
    border-color var(--ke-transition-fast), color var(--ke-transition-fast);
}

.ke-nav a.is-active,
.ke-nav a:hover {
  opacity: 1;
  color: #f9fbff;
  border-color: rgba(148, 163, 184, 0.9);
}

/* -------- GENERIC HERO -------- */

.hero,
.ke-hero {
  margin-top: 1rem;
  margin-bottom: 1.8rem;
}

.hero-pill,
.ke-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: var(--ke-text-soft);
}

.hero-pill-dot,
.ke-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ke-accent);
}

.hero-title {
  font-size: clamp(1.8rem, 3.9vw, 2.4rem);
  line-height: 1.15;
  margin: 0.65rem 0 0.5rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--ke-accent), var(--ke-accent-purple));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle,
.ke-hero-sub {
  font-size: 0.96rem;
  color: var(--ke-text-soft);
  max-width: 560px;
}

/* -------- BUTTONS -------- */

.btn,
button,
input[type="submit"] {
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 1.1rem;
  border-radius: var(--ke-radius-pill);
  border: 1px solid transparent;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--ke-transition-fast), color var(--ke-transition-fast),
    border-color var(--ke-transition-fast), box-shadow var(--ke-transition-fast),
    transform var(--ke-transition-fast);
}

.btn-primary {
  background: radial-gradient(circle at top left, #38bdf8, #2563eb);
  color: #f9fbff;
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.65);
}

.btn-outline {
  background: transparent;
  color: var(--ke-text-soft);
  border-color: rgba(148, 163, 184, 0.6);
}

.btn-outline:hover {
  border-color: rgba(148, 163, 184, 0.95);
  background: rgba(15, 23, 42, 0.85);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.35);
  border-color: transparent;
  color: var(--ke-text-soft);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.7);
}

/* -------- CARD GRIDS -------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.card {
  border-radius: var(--ke-radius-md);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), #020617);
  border: 1px solid var(--ke-border-subtle);
  padding: 0.95rem 1rem;
  box-shadow: var(--ke-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform var(--ke-transition-fast), box-shadow var(--ke-transition-fast),
    border-color var(--ke-transition-fast), background var(--ke-transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.92);
  box-shadow: var(--ke-shadow-strong);
}

.card-title {
  font-size: 0.98rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--ke-text-muted);
}

.card-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.9);
}

/* Badge / pill */
.badge,
.ke-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: rgba(8, 47, 73, 0.95);
  color: #e0f2fe;
}

/* -------- HYBRID WHITE SECTIONS -------- */

.ke-white-panel {
  background: radial-gradient(circle at top, #ffffff, #eef2ff 55%, #e2e8f0 100%);
  color: var(--ke-text-onlight);
  border-radius: 1.5rem;
  padding: 1.3rem 1.2rem 1.4rem;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.ke-white-card {
  border-radius: 1.1rem;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

/* -------- TABLES -------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--ke-text-soft);
}

/* -------- FORM ELEMENTS -------- */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: var(--ke-text-main);
  outline: none;
  transition: border-color var(--ke-transition-fast), box-shadow var(--ke-transition-fast),
    background var(--ke-transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
}

/* -------- FOOTER -------- */

footer,
.ke-footer {
  margin-top: 2.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(30, 64, 175, 0.7);
  font-size: 0.8rem;
  color: var(--ke-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.ke-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.ke-footer-links a {
  text-decoration: none;
  opacity: 0.8;
}

.ke-footer-links a:hover {
  opacity: 1;
}

/* -------- RESPONSIVE -------- */

@media (max-width: 768px) {
  .page-shell,
  .ke-shell {
    padding-inline: 0.9rem;
  }

  .ke-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .ke-nav {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .hero-title {
    font-size: 1.7rem;
  }
}

/* Note: classes-specific extra styles are inline in HTML files as ke-classes mini CSS. */
