/* HakariCAI - Stellar Theme CSS */
:root {
  /* Stellar Color Palette */
  --stellar-primary: #6366f1;
  --stellar-secondary: #8b5cf6;
  --stellar-accent: #06b6d4;
  --stellar-background: #0f0f23;
  --stellar-surface: #1a1a2e;
  --stellar-surface-light: #16213e;
  --stellar-text: #e2e8f0;
  --stellar-text-muted: #94a3b8;
  --stellar-border: #334155;
  --stellar-success: #10b981;
  --stellar-warning: #f59e0b;
  --stellar-error: #ef4444;

  /* Typography */
  --font-primary: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

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

body {
  font-family: var(--font-primary);
  background: var(--stellar-background);
  color: var(--stellar-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Pattern */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--stellar-background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner-wrapper {
  text-align: center;
}

.stellar-spinner {
  width: 60px;
  height: 60px;
  position: relative;
  margin: 0 auto var(--spacing-md);
}

.stellar-orbit {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  position: relative;
  animation: stellarRotate 2s linear infinite;
}

.stellar-planet {
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, var(--stellar-primary), var(--stellar-accent));
  border-radius: 50%;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes stellarRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Navbar */
.navbar {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stellar-border);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--stellar-primary), var(--stellar-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-badge {
  background: var(--stellar-surface-light);
  color: var(--stellar-text);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--stellar-border);
}

/* Hero Section */
.hero-section {
  padding: var(--spacing-2xl) 0;
  text-align: center;
}

.hero-banner {
  width: 100%;
  max-width: 400px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 1px solid var(--stellar-border);
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.main-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--stellar-primary), var(--stellar-secondary), var(--stellar-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--stellar-text-muted);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.api-links {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.api-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--stellar-surface);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-md);
  color: var(--stellar-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.api-link:hover {
  background: var(--stellar-surface-light);
  border-color: var(--stellar-primary);
  transform: translateY(-2px);
}

/* Search Section */
.search-section {
  margin-bottom: var(--spacing-xl);
}

.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--stellar-text-muted);
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 3rem;
  background: var(--stellar-surface);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-lg);
  color: var(--stellar-text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--stellar-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.clear-btn {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--stellar-text-muted);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.clear-btn:hover {
  color: var(--stellar-text);
  background: var(--stellar-surface-light);
}

/* Categories Section */
.categories-section {
  margin-bottom: var(--spacing-xl);
}

.categories-slider {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  padding: var(--spacing-sm) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-slider::-webkit-scrollbar {
  display: none;
}

.category-btn {
  flex-shrink: 0;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--stellar-surface);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-lg);
  color: var(--stellar-text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
  background: var(--stellar-primary);
  border-color: var(--stellar-primary);
  color: white;
  transform: translateY(-2px);
}

/* API Content */
.api-content {
  display: grid;
  gap: var(--spacing-lg);
}

.api-category {
  background: var(--stellar-surface);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  transition: all 0.3s ease;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  color: var(--stellar-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.api-card {
  background: var(--stellar-background);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.api-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--stellar-primary), var(--stellar-accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.api-card:hover::before {
  transform: scaleX(1);
}

.api-card:hover {
  border-color: var(--stellar-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.api-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--stellar-text);
}

.api-desc {
  color: var(--stellar-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.api-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--stellar-accent);
  background: rgba(6, 182, 212, 0.1);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-sm);
  display: inline-block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--stellar-surface);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--stellar-border);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--stellar-text);
  margin-bottom: var(--spacing-xs);
}

.modal-desc {
  color: var(--stellar-text-muted);
  font-size: 0.875rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--stellar-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: var(--stellar-text);
  background: var(--stellar-surface-light);
}

.modal-body {
  padding: var(--spacing-xl);
}

.section-label {
  display: block;
  font-weight: 600;
  color: var(--stellar-text);
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.endpoint-section,
.response-section {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.endpoint-code,
.response-code {
  background: var(--stellar-background);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--stellar-accent);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--stellar-surface-light);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-sm);
  color: var(--stellar-text-muted);
  padding: var(--spacing-xs) var(--spacing-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.75rem;
}

.copy-btn:hover {
  background: var(--stellar-primary);
  color: white;
  border-color: var(--stellar-primary);
}

.query-inputs {
  margin-bottom: var(--spacing-lg);
}

.query-input-group {
  margin-bottom: var(--spacing-md);
}

.query-input-group label {
  display: block;
  font-weight: 500;
  color: var(--stellar-text);
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
}

.query-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--stellar-background);
  border: 1px solid var(--stellar-border);
  border-radius: var(--radius-md);
  color: var(--stellar-text);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.query-input:focus {
  outline: none;
  border-color: var(--stellar-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.loading-section {
  text-align: center;
  padding: var(--spacing-xl);
}

.modal-footer {
  padding: var(--spacing-xl);
  border-top: 1px solid var(--stellar-border);
  display: flex;
  justify-content: flex-end;
}

.submit-btn {
  background: var(--stellar-primary);
  border: none;
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.submit-btn:hover {
  background: var(--stellar-secondary);
  transform: translateY(-2px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Error Pages */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl);
}

.error-content h1 {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--stellar-primary), var(--stellar-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-md);
}

.error-content p {
  color: var(--stellar-text-muted);
  font-size: 1.125rem;
  margin-bottom: var(--spacing-xl);
}

.error-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--stellar-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.3s ease;
}

.error-btn:hover {
  background: var(--stellar-secondary);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  .main-title {
    font-size: 2rem;
  }

  .title-container {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .api-grid {
    grid-template-columns: 1fr;
  }

  .modal-container {
    width: 95%;
    margin: var(--spacing-md);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--spacing-md);
  }
}

/* Syntax Highlighting for JSON */
.json-key {
  color: var(--stellar-accent);
}

.json-string {
  color: var(--stellar-success);
}

.json-number {
  color: var(--stellar-warning);
}

.json-boolean {
  color: var(--stellar-secondary);
}

.json-null {
  color: var(--stellar-text-muted);
}

/* Hidden class */
.hidden {
  display: none !important;
}

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

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