﻿/**
 * aipp V2 Dark Protocol — Shared Visual System
 * Standard Design Tokens & Reusable UI Foundation
 */

:root {
  /* Surface & Background Tokens */
  --v2-bg-page: #070b12;
  --v2-bg-surface: #0b111c;
  --v2-bg-surface-elevated: #111a2a;
  --v2-bg-surface-subtle: #080e18;
  --v2-bg-input: #070b12;
  --v2-bg-code: #040810;
  --v2-bg-card: #0b111c;
  --v2-bg-card-hover: #0f172a;

  /* Border Tokens */
  --v2-border: #1e293b;
  --v2-border-subtle: #131d2e;
  --v2-border-elevated: #27354a;
  --v2-border-focus: #3b82f6;

  /* Typography Tokens */
  --v2-text-primary: #f8fafc;
  --v2-text-body: #94a3b8;
  --v2-text-secondary: #94a3b8;
  --v2-text-muted: #64748b;
  --v2-text-subtle: #475569;
  --v2-text-light: #ffffff;

  /* Accent Tokens */
  --v2-accent-cobalt: #3b82f6;
  --v2-accent-cobalt-hover: #2563eb;
  --v2-accent-cyan: #38bdf8;
  --v2-accent-amber: #f59e0b;
  --v2-accent-amber-light: #fbbf24;
  --v2-accent-green: #10b981;
  --v2-accent-green-bright: #34d399;
  --v2-accent-red: #ef4444;
  --v2-accent-red-bright: #f87171;

  /* Badge Backgrounds */
  --v2-badge-blue-bg: rgba(59, 130, 246, 0.12);
  --v2-badge-blue-border: rgba(59, 130, 246, 0.3);
  --v2-badge-amber-bg: rgba(245, 158, 11, 0.12);
  --v2-badge-amber-border: rgba(245, 158, 11, 0.3);
  --v2-badge-green-bg: rgba(16, 185, 129, 0.12);
  --v2-badge-green-border: rgba(16, 185, 129, 0.3);
  --v2-badge-red-bg: rgba(239, 68, 68, 0.12);
  --v2-badge-red-border: rgba(239, 68, 68, 0.3);

  /* Radius */
  --v2-radius-sm: 6px;
  --v2-radius-md: 10px;
  --v2-radius-lg: 16px;
  --v2-radius-pill: 9999px;

  /* Shadows */
  --v2-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --v2-shadow-elevated: 0 12px 36px rgba(0, 0, 0, 0.5);
  --v2-shadow-glow-blue: 0 0 15px rgba(59, 130, 246, 0.2);
  --v2-shadow-glow-amber: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* Base Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--v2-bg-page);
  color: var(--v2-text-primary);
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Containers */
.v2-shell {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
}

/* Brand Wordmark */
.v2-brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--v2-text-light);
}

.v2-brand-dot {
  color: var(--v2-accent-amber);
  font-size: 24px;
  line-height: 0;
  font-weight: 900;
}

/* Navigation Shell */
.v2-nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--v2-border);
  background: rgba(7, 11, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.v2-navlinks {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  color: var(--v2-text-muted);
}

.v2-navlinks a {
  font-weight: 500;
  transition: color 0.15s ease;
}

.v2-navlinks a:hover,
.v2-navlinks a.active {
  color: var(--v2-text-light);
}

/* Buttons */
.v2-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--v2-radius-md);
  background: var(--v2-accent-cobalt);
  color: var(--v2-text-light) !important;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.v2-btn-primary:hover {
  background: var(--v2-accent-cobalt-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.v2-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--v2-radius-md);
  background: var(--v2-bg-surface);
  color: var(--v2-text-primary) !important;
  font-size: 13px;
  font-weight: 650;
  border: 1px solid var(--v2-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.v2-btn-secondary:hover {
  background: var(--v2-bg-surface-elevated);
  border-color: var(--v2-accent-cobalt);
  transform: translateY(-1px);
}

.v2-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--v2-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.v2-btn-ghost:hover {
  color: var(--v2-text-light);
}

/* Badges & Technical Pills */
.v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: var(--v2-radius-sm);
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.v2-badge-blue {
  background: var(--v2-badge-blue-bg);
  border: 1px solid var(--v2-badge-blue-border);
  color: var(--v2-accent-cyan);
}

.v2-badge-amber {
  background: var(--v2-badge-amber-bg);
  border: 1px solid var(--v2-badge-amber-border);
  color: var(--v2-accent-amber);
}

.v2-badge-green {
  background: var(--v2-badge-green-bg);
  border: 1px solid var(--v2-badge-green-border);
  color: var(--v2-accent-green-bright);
}

.v2-badge-red {
  background: var(--v2-badge-red-bg);
  border: 1px solid var(--v2-badge-red-border);
  color: var(--v2-accent-red-bright);
}

/* Cards & Surfaces */
.v2-card {
  background: var(--v2-bg-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  padding: 24px;
  box-shadow: var(--v2-shadow-card);
}

/* Form Inputs */
.v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v2-text-muted);
}

.v2-input {
  width: 100%;
  height: 40px;
  background: var(--v2-bg-input);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-md);
  padding: 0 12px;
  color: var(--v2-text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.v2-input:focus {
  border-color: var(--v2-border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
  background: #0d1421;
}

.v2-input::placeholder {
  color: var(--v2-text-subtle);
}

/* Code Blocks */
.v2-code-block {
  background: var(--v2-bg-code);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-md);
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-x: auto;
}

/* Technical Links */
.v2-link {
  color: var(--v2-accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.v2-link:hover {
  color: var(--v2-accent-amber);
  text-decoration: underline;
}

/* Footer */
.v2-footer {
  border-top: 1px solid var(--v2-border);
  padding: 32px 0 40px;
  color: var(--v2-text-muted);
  font-size: 12.5px;
}

.v2-foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.v2-footlinks {
  display: flex;
  gap: 20px;
}

.v2-footlinks a {
  transition: color 0.15s ease;
}

.v2-footlinks a:hover {
  color: var(--v2-text-light);
}

@media (max-width: 720px) {
  .v2-foot-inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
}

/* ── Shared Responsive Utilities ── */
.v2-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v2-break-all {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.v2-break-word {
  word-break: break-word;
  overflow-wrap: break-word;
}

.v2-touch-target {
  min-height: 44px;
  min-width: 44px;
}

@media (max-width: 640px) {
  .v2-shell {
    width: min(1140px, calc(100% - 24px));
  }
  .v2-card {
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .v2-shell {
    width: min(1140px, calc(100% - 20px));
  }
  .v2-card {
    padding: 16px 14px;
    border-radius: var(--v2-radius-md);
  }
  .v2-btn-primary, .v2-btn-secondary {
    padding: 10px 14px;
    font-size: 12.5px;
  }
}
