@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Premium Dark Theme Core */
  --bg-deep:   #020617;
  --bg-top:    #0f172a;
  --surface:   rgba(30, 41, 59, 0.45);
  --glass-fx:  blur(16px);
  --border:    rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  /* Vibrant Accents */
  --accent:       #38bdf8;
  --accent-glow:  rgba(56, 189, 248, 0.3);
  --accent-grad:  linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  
  /* Text */
  --text:      #f8fafc;
  --text-dim:  #cbd5e1;
  --muted:     #94a3b8;
  
  /* Semantic */
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --success:   #10b981;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 50% -20%, var(--bg-top), var(--bg-deep) 70%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Custom Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-brand svg { 
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* ── Layout ──────────────────────────────────────────────── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  opacity: 0.3;
}

.page-header .label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 70%;
}

/* ── Login Adjustments ───────────────────────────────────── */
.auth-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  background: var(--surface) !important;
  backdrop-filter: var(--glass-fx);
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5) !important;
  padding: 3rem !important;
  width: 100%;
  max-width: 440px;
}
.auth-box h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
}
input[type="text"], input[type="password"] {
  width: 100%;
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid var(--border) !important;
  color: #fff !important;
  padding: 0.8rem 1rem !important;
  border-radius: 10px !important;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1.25rem;
}
input:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}
button {
  background: var(--accent-grad) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s !important;
  width: 100%;
  font-size: 1rem;
}
button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px -5px var(--accent-glow) !important;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: var(--glass-fx);
  -webkit-backdrop-filter: var(--glass-fx);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card h2 svg { color: var(--accent); flex-shrink: 0; filter: drop-shadow(0 0 5px var(--accent-glow)); }

.card p, .card li {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── Grid ────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ── Link cards ──────────────────────────────────────────── */
.link-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: transparent;
  transition: background 0.3s;
}

.link-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px -12px rgba(0,0,0,0.5), 0 0 20px -5px var(--accent-glow);
  background: rgba(30, 41, 59, 0.8);
}

.link-card:hover::before {
  background: var(--accent-grad);
}

.link-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.link-card-text {
  flex: 1;
}

.link-card-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.2px;
}

.link-card-text span {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  display: block;
}

/* ── Table ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  margin: 1rem 0;
}

th {
  background: rgba(0,0,0,0.2);
  color: var(--text-dim);
  font-weight: 500;
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }

td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--muted);
  transition: background 0.2s;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); color: var(--text); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.badge-green  { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: #34d399; }
.badge-teal   { background: rgba(20,184,166,0.1); border-color: rgba(20,184,166,0.2); color: #2dd4bf; }
.badge-blue   { background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.2); color: #7dd3fc; }
.badge-orange { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.2); color: #fb923c; }
.badge-purple { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.2); color: #a78bfa; }
.badge-red    { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.2);  color: #f87171; }

/* ── Custom App Colors (Inline strokes override) ────────── */
.app-stroke-teal { stroke: #2dd4bf; filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.4)); }
.app-stroke-blue { stroke: #38bdf8; filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4)); }
.app-stroke-purple { stroke: #c084fc; filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.4)); }
.app-stroke-orange { stroke: #fb923c; filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.4)); }
.app-stroke-red { stroke: #fb7185; filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.4)); }

/* ── App Grid (unified portal) ──────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.app-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: transparent;
  transition: background 0.25s;
}

.app-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.5), 0 0 16px -4px var(--accent-glow);
  background: rgba(30, 41, 59, 0.7);
}

.app-card:hover::before {
  background: var(--accent-grad);
}

.app-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.app-card-body { flex: 1; min-width: 0; }

.app-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.app-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.app-card-url {
  font-size: 0.7rem;
  color: var(--accent);
  font-family: monospace;
  opacity: 0.7;
}

/* ── Code / Diagram / Steps ──────────────────────────────── */
pre, code, .diagram {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.diagram-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.step-num {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .page { padding: 2rem 1rem 3rem; }
  .page-header h1 { font-size: 1.8rem; }
  .page-header p { max-width: 100%; font-size: 0.95rem; }
  .app-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
