/* Aurora AI-Vision — Космическая станция: лейаут */

/* Космический фон со звёздами (canvas в starfield.js) */
.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(30, 58, 120, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 45%),
    var(--bg-deep);
  pointer-events: none;
}
.cosmic-bg canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Auth & Landing */
.auth-page, .landing-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: transparent;
}

.auth-card, .landing-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
}

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-8);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: none;
  border-bottom: 1px solid var(--glass-border);
}
.landing-nav.glass { border-radius: 0; }
/* Стили логотипа на лендинге — в components.css (.brand-wordmark, .landing-nav .brand) */
.landing-nav .landing-cta { display: flex; gap: var(--space-3); }

.landing-hero {
  padding: calc(80px + var(--space-10)) var(--space-6) var(--space-10);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.landing-hero.glass {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-4);
  line-height: 1.2;
  color: var(--text);
}
.landing-hero .lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: 1.7;
}
.landing-hero .hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.landing-section {
  padding: var(--space-10) var(--space-6);
  max-width: 720px;
  margin: 0 auto;
  border-top: 1px solid var(--glass-border);
}
.landing-section.glass {
  border-top: none;
  border: 1px solid var(--glass-border);
  margin: var(--space-6) auto;
  box-shadow: var(--shadow-sm);
}
.landing-section.glass:first-of-type { margin-top: var(--space-8); }
.landing-final.glass {
  border: 1px solid var(--glass-border);
  margin: var(--space-6) auto var(--space-10);
  box-shadow: var(--shadow-sm);
}
.landing-section h2 {
  font-size: 1.4rem;
  margin-bottom: var(--space-4);
  color: var(--text);
}
.landing-section p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}
.landing-section p:last-child { margin-bottom: 0; }
.landing-section .steps { margin-top: var(--space-6); }
.landing-section .step {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  align-items: flex-start;
}
.landing-section .step-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease);
}
.landing-section .step:hover .step-num {
  transform: scale(1.05);
}
.landing-section .step p { margin-bottom: 0; }

.landing-final {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  border-top: 1px solid var(--border);
}
.landing-final h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}
.landing-final .hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.auth-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.auth-footer a { margin: 0 var(--space-2); }

/* Dashboard — фон прозрачный, чтобы был виден космический starfield */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: transparent;
}

.dashboard-main {
  flex: 1;
  margin-left: 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 1100px;
  margin: 0;
  width: 100%;
}

@media (max-width: 768px) {
  .dashboard-main { margin-left: 0; }
  .aurora-sidebar {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: var(--space-2);
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .aurora-sidebar a .sidebar-label { display: none; }
  .aurora-sidebar a { margin: 0; padding: var(--space-2) var(--space-3); }
  .dashboard-content { padding: var(--space-4); }
}

.section { margin-bottom: var(--space-6); }
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-4);
}

/* Tabs */
.cosmic-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  padding: var(--space-1);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: fit-content;
}
.cosmic-tabs button {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cosmic-tabs button:hover {
  color: var(--text);
  background: var(--surface);
}
.cosmic-tabs button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-sm);
}

.cosmic-panel { display: none; }
.cosmic-panel.active { display: block; }

/* Stream / video */
.stream-wrap .stream-view {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  /* aspect-ratio задаётся в JS по streamVideo.videoWidth / videoHeight */
}
.stream-wrap:fullscreen, .stream-wrap:-webkit-full-screen, .stream-wrap.fullscreen {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #000;
}
.stream-wrap:fullscreen .stream-view, .stream-wrap:-webkit-full-screen .stream-view, .stream-wrap.fullscreen .stream-view {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
}
.stream-wrap:fullscreen video, .stream-wrap:-webkit-full-screen video, .stream-wrap.fullscreen video {
  width: 100% !important; height: 100% !important;
  max-width: none;
  object-fit: contain;
}

.stream-controls {
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.stream-controls label { font-size: 0.875rem; color: var(--text-secondary); }

.video-actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.video-actions .neon-btn { min-width: 100px; }

.cosmic-select {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  min-width: 200px;
  font-size: 0.875rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cosmic-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.video-wrap {
  position: relative;
  display: inline-block;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.video-wrap video, .video-wrap canvas, .video-wrap img { display: block; max-width: 100%; }

.current-detections {
  padding: var(--space-4);
  min-height: 56px;
  margin-top: var(--space-4);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.current-detections:empty::before { content: 'Нет данных'; color: var(--text-muted); }
.detections-list { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.detections-list .error-msg { color: var(--error); }

/* API документация (настройки) */
.api-doc-block {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.api-doc-block:first-of-type { margin-top: var(--space-4); padding-top: 0; border-top: none; }
.api-doc-h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.api-doc-pre {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}
.api-doc-pre code { background: none; border: none; padding: 0; color: inherit; }
