/* === Orbital Compute Simulator — Shared Styles === */

:root {
  --bg-primary: #0a0e17;
  --bg-card: #141b2d;
  --bg-card-hover: #1a2340;
  --accent: #4fc3f7;
  --accent-dim: #2196f3;
  --text-primary: #e0e6f0;
  --text-secondary: #8892a4;
  --text-muted: #5a6478;
  --border: #1e2a42;
  --success: #66bb6a;
  --warning: #ffa726;
  --danger: #ef5350;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Navigation === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav-brand svg { width: 24px; height: 24px; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

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

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: rgba(79, 195, 247, 0.08);
  text-decoration: none;
}

.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* === Hero === */
.hero {
  text-align: center;
  padding: 4rem 2rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #b388ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(79, 195, 247, 0.2);
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(79, 195, 247, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* === Stats Row === */
.stats-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === Section === */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #0a0e17;
}

.btn-primary:hover { background: #29b6f6; }

.btn-secondary {
  background: rgba(79, 195, 247, 0.1);
  color: var(--accent);
  border: 1px solid rgba(79, 195, 247, 0.2);
}

.btn-secondary:hover { background: rgba(79, 195, 247, 0.2); }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* === Controls Panel === */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-group input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.control-group select {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  font-family: var(--font);
  font-size: 0.9rem;
}

.control-value {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

/* === Tables === */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

tr:hover td { background: rgba(79, 195, 247, 0.03); }

/* === Code Blocks === */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  line-height: 1.5;
  color: #c9d1d9;
}

.code-block .comment { color: #8b949e; }
.code-block .string { color: #a5d6ff; }
.code-block .keyword { color: #ff7b72; }
.code-block .number { color: #79c0ff; }

/* === Badge === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(102, 187, 106, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 167, 38, 0.15); color: var(--warning); }
.badge-danger  { background: rgba(239, 83, 80, 0.15); color: var(--danger); }
.badge-info    { background: rgba(79, 195, 247, 0.15); color: var(--accent); }

/* === Canvas Container === */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.chart-container canvas {
  width: 100%;
  height: 300px;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* === Globe Container === */
#globe-container {
  width: 100%;
  height: calc(100vh - 60px);
  position: relative;
}

#globe-container canvas { display: block; }

.globe-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
}

.globe-info {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(20, 27, 45, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 220px;
  backdrop-filter: blur(8px);
}

.time-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(20, 27, 45, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(8px);
}

.time-controls input[type="range"] { width: 300px; }

.time-controls button {
  background: rgba(79, 195, 247, 0.15);
  border: 1px solid rgba(79, 195, 247, 0.3);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
}

/* === API Docs === */
.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.endpoint-header:hover { background: rgba(79, 195, 247, 0.03); }

.method {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.method-get { background: rgba(102, 187, 106, 0.15); color: var(--success); }
.method-post { background: rgba(79, 195, 247, 0.15); color: var(--accent); }
.method-put { background: rgba(255, 167, 38, 0.15); color: var(--warning); }
.method-delete { background: rgba(239, 83, 80, 0.15); color: var(--danger); }

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.endpoint-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-left: auto;
}

.endpoint-body {
  padding: 1.25rem;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 3rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1rem; }
  .container, .container-wide { padding: 1rem; }
  .controls-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 1rem; }
  .time-controls { flex-wrap: wrap; width: 90%; }
  .time-controls input[type="range"] { width: 100%; }
}

/* === Utility === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.85rem; }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

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