/* =============================================
   AUDITA — theme.css
   Shared across all pages: variables, base,
   grid background, loader bar, animations
   ============================================= */

/* --- CSS Variables --- */
:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: #2a2a3a;
  --accent: #00ff88;
  --accent2: #0088ff;
  --accent3: #ff6b35;
  --warn: #ffcc00;
  --text: #e8e8f0;
  --muted: #666680;
  --good: #00ff88;
  --bad: #ff4466;
  --mid: #ffcc00;
}

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

/* --- Base Body --- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Grid Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* --- Error Message --- */
.error-msg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--bad);
  opacity: 0;
  transition: opacity 0.3s;
}
.error-msg.visible { opacity: 1; }

/* --- Loader Bar --- */
.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 2px;
}
.loader-bar-bg {
  width: 320px;
  height: 2px;
  background: var(--surface2);
  border-radius: 1px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent);
}

/* --- GitHub Repo Link (fixed bottom-left) --- */
.gh-link {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  text-decoration: none;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.gh-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 16px rgba(0,255,136,0.1);
}
.gh-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Server Waking Pill --- */
/* Shows bottom-right after 5s if any API call hasn't returned yet */
.waking-pill {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.waking-pill.visible {
  opacity: 1;
  transform: translateY(0);
}
.waking-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: wakePulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes wakePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.7); }
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}