/* ═══════════════════════════════════════════════════════════════
   GeoGebra EDU360 — Global Styles
   ═══════════════════════════════════════════════════════════════ */
:root {
  --edu-dark:    #00102b;
  --edu-navy:    #001f5c;
  --edu-blue:    #0050b3;
  --edu-light:   #4da3ff;
  --edu-teal:    #00c4d4;
  --edu-accent:  #ff6b35;
  --edu-bg:      #f0f4ff;
  --edu-surface: #ffffff;
  --header-h:    58px;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(0,31,92,.12);
  --shadow-lg:   0 8px 48px rgba(0,31,92,.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--edu-bg);
  color: #1a2a4a;
  min-height: 100vh;
}

/* ── HEADER ── */
.edu-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--edu-dark) 0%, var(--edu-navy) 60%, var(--edu-blue) 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.edu-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--edu-teal), var(--edu-light), var(--edu-teal));
}

.hdr-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.hdr-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--edu-light), var(--edu-blue));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(77,163,255,.4);
  border: 1.5px solid rgba(255,255,255,.25);
  flex-shrink: 0;
}
.hdr-logo svg { width: 20px; height: 20px; fill: #fff; }
.hdr-name { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.hdr-sub  { color: rgba(255,255,255,.45); font-size: 9.5px; font-weight: 600;
            letter-spacing: .8px; text-transform: uppercase; display: block; margin-top: 1px; }

.hdr-nav { display: flex; align-items: center; gap: 4px; }
.hdr-nav a {
  color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; text-decoration: none;
  transition: all .18s ease;
}
.hdr-nav a:hover, .hdr-nav a.active {
  background: rgba(255,255,255,.12); color: #fff;
}
.hdr-nav a.active { background: rgba(77,163,255,.22); color: var(--edu-light); }

.hdr-right { display: flex; align-items: center; gap: 10px; }
.hdr-badge {
  background: rgba(0,196,212,.15); border: 1px solid rgba(0,196,212,.3);
  color: var(--edu-teal); font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; letter-spacing: .5px;
  text-transform: uppercase;
}
.hdr-portal-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; text-decoration: none;
  transition: all .18s ease;
}
.hdr-portal-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── HERO ── */
.hero {
  margin-top: var(--header-h);
  padding: 64px 24px 48px;
  background: linear-gradient(155deg, var(--edu-dark) 0%, var(--edu-navy) 40%, #003399 70%, var(--edu-blue) 100%);
  position: relative; overflow: hidden; text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 52px 52px;
}
.hero-orb1 {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77,163,255,.18) 0%, transparent 65%);
  top: -180px; right: -100px; pointer-events: none;
}
.hero-orb2 {
  position: absolute; width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,196,212,.14) 0%, transparent 65%);
  bottom: -80px; left: -60px; pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(77,163,255,.15); border: 1px solid rgba(77,163,255,.3);
  color: var(--edu-light); font-size: 11px; font-weight: 700;
  padding: 5px 14px; border-radius: 20px; letter-spacing: .6px;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(28px, 5vw, 42px); font-weight: 900;
  color: #fff; line-height: 1.15; margin-bottom: 16px;
  letter-spacing: -.5px;
}
.hero-title span { color: var(--edu-teal); }
.hero-desc { color: rgba(255,255,255,.65); font-size: 16px; line-height: 1.6; margin-bottom: 32px; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-chip {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 20px;
}

/* ── MAIN CONTENT ── */
.main { max-width: 1200px; margin: 0 auto; padding: 48px 24px 80px; }

.section-title {
  font-size: 22px; font-weight: 800; color: var(--edu-navy);
  margin-bottom: 6px; display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; display: block; width: 4px; height: 22px;
  background: linear-gradient(var(--edu-teal), var(--edu-blue));
  border-radius: 2px;
}
.section-sub { color: #6b7a99; font-size: 14px; margin-bottom: 28px; margin-left: 14px; }

/* ── APP GRID ── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.app-card {
  background: var(--edu-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
  border: 1.5px solid rgba(0,31,92,.06);
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,80,179,.15);
}
.app-card-banner {
  height: 120px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.app-card-banner svg { width: 52px; height: 52px; opacity: .9; position: relative; z-index: 1; }
.app-card-banner::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 30% 40%, rgba(255,255,255,.15) 0%, transparent 60%);
}

.app-card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.app-card-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  margin-bottom: 6px; opacity: .7;
}
.app-card-name { font-size: 17px; font-weight: 800; margin-bottom: 6px; color: var(--edu-navy); }
.app-card-desc { font-size: 13px; color: #6b7a99; line-height: 1.5; flex: 1; margin-bottom: 16px; }
.app-card-footer { display: flex; align-items: center; justify-content: space-between; }
.app-card-levels {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.level-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(0,80,179,.08); color: var(--edu-blue);
}
.app-card-arrow {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--edu-bg); transition: background .18s;
}
.app-card:hover .app-card-arrow { background: var(--edu-blue); }
.app-card-arrow svg { width: 16px; height: 16px; fill: var(--edu-blue); transition: fill .18s; }
.app-card:hover .app-card-arrow svg { fill: #fff; }

/* ── TOOLS SECTION ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 56px;
}
.tool-card {
  background: var(--edu-surface); border-radius: 10px;
  padding: 18px 16px; display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
  box-shadow: 0 2px 12px rgba(0,31,92,.07);
  border: 1.5px solid rgba(0,31,92,.05);
  transition: all .18s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(0,80,179,.15); }
.tool-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tool-icon svg { width: 22px; height: 22px; fill: #fff; }
.tool-name { font-size: 13px; font-weight: 700; color: var(--edu-navy); }
.tool-cat  { font-size: 11px; color: #8896b3; margin-top: 2px; }

/* ── INFO BANNER ── */
.info-banner {
  background: linear-gradient(135deg, var(--edu-navy), var(--edu-blue));
  border-radius: var(--radius); padding: 28px 32px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 56px; box-shadow: var(--shadow-lg);
}
.info-banner-icon {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
}
.info-banner-icon svg { width: 28px; height: 28px; fill: var(--edu-teal); }
.info-banner-text h3 { color: #fff; font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.info-banner-text p { color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.5; }
.info-banner-btn {
  margin-left: auto; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.25);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 10px 22px; border-radius: 8px; text-decoration: none;
  white-space: nowrap; transition: background .18s;
}
.info-banner-btn:hover { background: rgba(255,255,255,.22); }

/* ── FOOTER ── */
.edu-footer {
  background: var(--edu-dark); color: rgba(255,255,255,.4);
  text-align: center; padding: 20px 24px; font-size: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.edu-footer a { color: var(--edu-teal); text-decoration: none; }
.edu-footer strong { color: rgba(255,255,255,.65); }

/* ── APP PAGE ── */
body.app-page { overflow: hidden; }
body.app-page .edu-header { position: fixed; }
.app-frame-wrap {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
}
.app-topbar {
  background: var(--edu-surface); border-bottom: 1px solid rgba(0,31,92,.1);
  height: 44px; display: flex; align-items: center; padding: 0 16px; gap: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.app-topbar-title { font-size: 14px; font-weight: 700; color: var(--edu-navy); }
.app-topbar-sep { width: 1px; height: 20px; background: rgba(0,31,92,.1); }
.app-topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.topbar-btn {
  background: var(--edu-bg); border: 1px solid rgba(0,31,92,.1);
  color: var(--edu-blue); font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer; text-decoration: none;
  display: flex; align-items: center; gap: 5px; transition: all .15s;
}
.topbar-btn:hover { background: var(--edu-blue); color: #fff; border-color: var(--edu-blue); }
.topbar-btn svg { width: 13px; height: 13px; fill: currentColor; }
#ggb-container {
  width: 100%; height: calc(100vh - var(--header-h) - 44px);
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .hdr-nav { display: none; }
  .hero { padding: 48px 16px 36px; }
  .info-banner { flex-direction: column; text-align: center; }
  .info-banner-btn { margin-left: 0; }
  .apps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .apps-grid { grid-template-columns: 1fr; }
}
