/* COINjecture Web Interface - Multi-Page Layout */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0a0a0a;
  color: #e6e6e6;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Navigation Bar */
.navbar {
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  flex-direction: column;
}

.brand-text {
  font-size: 24px;
  font-weight: bold;
  color: #9d7ce8;
  font-family: 'Courier New', monospace;
}

.brand-subtitle {
  font-size: 12px;
  color: #888;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  color: #9d7ce8;
  background: #222;
}

.nav-link.active {
  color: #9d7ce8;
  background: #2a1a3a;
  border: 1px solid #9d7ce8;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 80px);
}

/* Page System */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Terminal Page */
.terminal-container {
  background: #000;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
}

.terminal-header {
  background: #111;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.terminal-title {
  color: #9d7ce8;
  font-weight: bold;
  font-size: 16px;
}

.status {
  font-size: 12px;
  color: #888;
}

.status.connected {
  color: #9d7ce8;
}

.status.offline {
  color: #ff6600;
}

.status.error {
  color: #ff0000;
}

.terminal-output {
  height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #000;
  font-size: 14px;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

.output-line {
  margin-bottom: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prompt {
  color: #9d7ce8;
  font-weight: bold;
  margin-right: 8px;
}

.command {
  color: #ffffff;
  font-weight: bold;
}

.output {
  color: #cccccc;
  white-space: pre-wrap;
}

.output.error {
  color: #ff6666;
}

.output.success {
  color: #66ff66;
}

.input-container {
  padding: 12px 16px;
  background: #111;
  border-top: 1px solid #333;
}

.input-line {
  display: flex;
  align-items: center;
  width: 100%;
}

#command-input {
  background: transparent;
  border: none;
  color: #ffffff;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  flex: 1;
  padding: 8px 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#command-input::placeholder {
  color: #666;
}

/* API Docs Page */
.page-content h1 {
  color: #9d7ce8;
  margin-bottom: 24px;
  font-size: 28px;
}

.api-section {
  margin-bottom: 32px;
}

.api-section h2 {
  color: #e6e6e6;
  margin-bottom: 16px;
  font-size: 20px;
}

.endpoint-list {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #333;
}

.endpoint {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #333;
  gap: 16px;
}

.endpoint:last-child {
  border-bottom: none;
}

.method {
  background: #9d7ce8;
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  min-width: 50px;
  text-align: center;
}

.url {
  color: #9d7ce8;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  min-width: 200px;
}

.description {
  color: #ccc;
  flex: 1;
}

code {
  background: #1a1a1a;
  color: #9d7ce8;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  border: 1px solid #333;
}

/* Download Page */
.download-section {
  margin-bottom: 32px;
}

.download-section h2 {
  color: #e6e6e6;
  margin-bottom: 16px;
  font-size: 20px;
}

.download-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.download-card h3 {
  color: #9d7ce8;
  margin-bottom: 8px;
  font-size: 18px;
}

.download-card p {
  color: #ccc;
  margin-bottom: 16px;
}

.download-card ul {
  list-style: none;
  margin-bottom: 20px;
}

.download-card li {
  color: #ccc;
  margin-bottom: 4px;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-number {
  background: #9d7ce8;
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.step-text {
  color: #ccc;
}

.platform-status {
  display: flex;
  gap: 24px;
}

.platform {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-name {
  color: #e6e6e6;
  font-weight: 500;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.status-badge.coming-soon {
  background: #ff6600;
  color: #000;
}

/* Buttons */
.btn-primary {
  background: #9d7ce8;
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #00cc00;
  transform: translateY(-1px);
}

.btn-download {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-download:hover {
  background: #0052a3;
  transform: translateY(-2px);
}

.test-result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.test-result.success {
  background: #2a1a3a;
  color: #9d7ce8;
  border: 1px solid #9d7ce8;
}

.test-result.error {
  background: #3a1a1a;
  color: #ff6666;
  border: 1px solid #ff6666;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
  }
  
  .nav-links {
    gap: 16px;
  }
  
  .main-content {
    padding: 16px;
  }
  
  .terminal-output {
    height: 300px;
    font-size: 13px;
  }
  
  .endpoint {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .url {
    min-width: auto;
    word-break: break-all;
  }
  
  .platform-status {
    flex-direction: column;
    gap: 16px;
  }
  
  #command-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .terminal-output {
    height: 250px;
    font-size: 12px;
  }
  
  .download-card {
    padding: 16px;
  }
  
  .install-steps {
    gap: 12px;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .nav-link {
    padding: 12px 16px;
    min-height: 44px;
  }
  
  .btn-primary,
  .btn-download {
    min-height: 44px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  body {
    background: #000000;
    color: #ffffff;
  }
  
  .brand-text {
    color: #9d7ce8;
  }
  
  .terminal-title {
    color: #9d7ce8;
  }
}