/* === SharpEdge Portal — Styles === */
/* Adapted from the Upshift Portal launcher. Dark, premium design system. */

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

:root {
  --bg:           #07060f;
  --surface:      #0f0d1f;
  --border:       rgba(255,255,255,0.08);
  --text:         #f0eeff;
  --muted:        rgba(240,238,255,0.5);
  --accent-ci:    #4A90E2;  /* Competitor Intelligence — blue */
  --accent-price: #E0A526;  /* Pricing Intelligence — gold */
  --accent-files: #34C0A0;  /* Shared Files — teal */
}

html {
  min-height: 100%;
  background: linear-gradient(135deg, #000000 0%, #1a1445 50%, #211951 100%);
}

body {
  min-height: 100%;
  color: var(--text);
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
}

#app { min-height: 100vh; }

/* ── HEADER ── (matches the CI app exactly so the chrome is seamless across apps) */
.header {
  background: linear-gradient(135deg, #000000 0%, #1a1445 50%, #211951 100%);
  text-align: center;
  padding: 1.8rem 3rem 2.6rem;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(74,144,226,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.header-logo {
  display: block;
  height: 125px;
  width: auto;
  margin: 0 auto 0.5rem;
  position: relative;
}

.header .subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  letter-spacing: 0.02em;
  max-width: 700px;
  margin: 0 auto 0.5rem;
  flex-wrap: wrap;
}

.header .subtitle span {
  display: flex;
  align-items: center;
}

.header .subtitle span::before {
  content: "\00B7";
  margin: 0 0.6rem;
  opacity: 0.4;
}

.header .subtitle span:first-child::before { display: none; }

/* ── Main ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 3rem 5rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ── App cards ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}

.app-card.ci::before      { background: var(--accent-ci); }
.app-card.pricing::before { background: var(--accent-price); }
.app-card.files::before   { background: var(--accent-files); }

.app-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

/* Disabled card — app not yet wired */
.app-card.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-card-team {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.app-card.ci      .app-card-team { color: var(--accent-ci); }
.app-card.pricing .app-card-team { color: var(--accent-price); }
.app-card.files   .app-card-team { color: var(--accent-files); }

.app-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.app-card-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.app-card-desc {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.app-card-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-card.ci      .app-card-cta { color: var(--accent-ci); }
.app-card.pricing .app-card-cta { color: var(--accent-price); }
.app-card.files   .app-card-cta { color: var(--accent-files); }

.app-card-cta-arrow { transition: transform 0.15s; }
.app-card:hover .app-card-cta-arrow { transform: translateX(3px); }

/* ── FOOTER ── (matches the CI app exactly) */
.sticky-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #000000;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.sticky-footer img { height: 22px; display: block; }
.sticky-footer .version { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-weight: 500; position: absolute; right: 1.5rem; }

/* ── Auth gate (sign-in / loading) — rendered into #app by ag-auth-google.js ── */
.agi-gate {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #000000 0%, #1a1445 50%, #211951 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 2rem; text-align: center; z-index: 2000;
}
.agi-gate-logo { height: 110px; width: auto; opacity: 0.95; }
.agi-gate-tagline { font-size: 0.85rem; letter-spacing: 0.04em; color: rgba(255,255,255,0.6); }
.agi-gate-msg { font-size: 0.8rem; color: #ffb4a8; max-width: 320px; }
.agi-gate-fine { font-size: 0.72rem; color: rgba(255,255,255,0.35); }
#agi-gsi-btn { display: flex; justify-content: center; min-height: 44px; }
.agi-gate-bar { width: 220px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; position: relative; }
.agi-gate-bar-fill {
  position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, #4A90E2, transparent);
  border-radius: 3px; animation: agi-sweep 1.4s ease-in-out infinite;
}
@keyframes agi-sweep { 0% { left: -60%; } 100% { left: 100%; } }
.agi-gate-label { font-size: 0.78rem; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; text-transform: uppercase; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  main { padding: 2.5rem 2rem 5rem; }
}

@media (max-width: 768px) {
  .header { padding: 1.5rem 1.5rem 2.2rem; }
  .header-logo { height: 86px; }
  main { padding: 2rem 1.25rem 5rem; }
  .app-grid { grid-template-columns: 1fr; }
  .sticky-footer { padding: 0.6rem 1.25rem; }
  .sticky-footer .version { right: 1.25rem; }
}
