/* ========================================
   DATA SURFER API DOCUMENTATION STYLES
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

:root {
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg-code: #f3f4f6;
  --bg-success: #dcfce7;
  --text-success: #166534;
  --sidebar-width: 320px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  background: #ffffff;
  height: 60px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.logo span { color: var(--text-muted); font-weight: 400; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.menu-toggle svg { width: 24px; height: 24px; }

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: calc(100vh - 60px);
  overflow-y: auto;
  background: #ffffff;
  flex-shrink: 0;
}

.sidebar h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}

.sidebar ul { list-style: none; margin-bottom: 2rem; }
.sidebar li { margin-bottom: 0.125rem; }

.sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.sidebar a:hover { background: var(--bg-code); color: var(--text-primary); }
.sidebar a.active { background: var(--primary); color: white; }

.sidebar .endpoint-path {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  margin-right: 1rem;
}

.sidebar .endpoint-path.sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sidebar .method-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sidebar .method-badge.get { background: #dbeafe; color: #1d4ed8; }
.sidebar .method-badge.post { background: #dcfce7; color: #166534; }
.sidebar .method-badge.put { background: #fef3c7; color: #92400e; }
.sidebar .method-badge.delete { background: #fee2e2; color: #991b1b; }
.sidebar .method-badge.patch { background: #f3e8ff; color: #6b21a8; }
.sidebar .endpoint-group { margin-bottom: 1rem; }

.sidebar .endpoint-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}

.sidebar a.active .method-badge { background: rgba(255, 255, 255, 0.2); color: white; }

/* Main content */
.main {
  flex: 1;
  padding: 3rem 4rem;
  min-width: 0;
}

.content { max-width: 900px; overflow-x: hidden; }

/* Hero */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 600px; }

.base-url {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-code);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.base-url-label {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.base-url-value { color: var(--primary-dark); font-weight: 500; }

/* Content sections */
.content section { margin-bottom: 4rem; }
.content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.content h3 { font-size: 1.125rem; font-weight: 600; margin: 2rem 0 1rem; }
.content h4 { font-size: 0.9375rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.content p { color: var(--text-secondary); margin-bottom: 1rem; }
.content a { color: var(--primary-dark); text-decoration: none; }
.content a:hover { text-decoration: underline; }

.content code {
  background: var(--bg-code);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

/* Endpoint badge */
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-code);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-family: 'JetBrains Mono', monospace;
}

.method {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.method-get { background: #dbeafe; color: #1d4ed8; }
.method-post { background: #dcfce7; color: #166534; }
.method-put { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #991b1b; }
.method-patch { background: #f3e8ff; color: #6b21a8; }
.endpoint-path { color: var(--text-primary); font-size: 0.9rem; }

/* Code blocks */
.code-block {
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
}

.code-header {
  background: #334155;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-header span {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.code-content { padding: 1rem; overflow-x: auto; }

.code-content pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: #e2e8f0;
  margin: 0;
  white-space: pre;
}

/* Copy button */
.copy-btn {
  background: transparent;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
.copy-btn.copied { color: #86efac; }
.copy-btn svg { width: 16px; height: 16px; }

/* Floating copy button for code blocks */
.code-block .copy-btn-float {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(51, 65, 85, 0.8);
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  opacity: 0;
  z-index: 10;
}

.code-block:hover .copy-btn-float { opacity: 1; }
.code-block .copy-btn-float:hover { background: rgba(51, 65, 85, 1); color: #e2e8f0; }
.code-block .copy-btn-float.copied { color: #86efac; }
.code-block .copy-btn-float svg { width: 16px; height: 16px; }

/* Code tabs */
.code-tabs { margin: 1rem 0; }

.code-tabs-nav {
  display: flex;
  gap: 0;
  background: #334155;
  border-radius: 8px 8px 0 0;
  padding: 0 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.code-tabs-nav::-webkit-scrollbar { display: none; }

.code-tab-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.code-tab-btn:hover { color: #e2e8f0; }
.code-tab-btn.active { color: #e2e8f0; border-bottom-color: var(--primary); }

.code-tab-content { display: none; }
.code-tab-content.active { display: block; }
.code-tab-content .code-block { margin: 0; border-radius: 0 0 8px 8px; }

/* Response tabs */
.response-tabs { margin: 1rem 0; }

.response-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.response-tab-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.response-tab-btn:hover { color: var(--text-primary); }
.response-tab-btn.active { color: var(--text-primary); border-bottom-color: var(--primary); }
.response-tab-btn.try-it-tab { color: var(--primary); }
.response-tab-btn.try-it-tab.active { border-bottom-color: var(--primary); }

.response-tab-content { display: none; }
.response-tab-content.active { display: block; }

/* Parameters table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.params-table th, .params-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.params-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-code);
}

.params-table td { color: var(--text-secondary); }
.params-table code { font-size: 0.8125rem; }

/* Try it panel */
.try-it-panel { padding: 1rem 0; }
.try-it-panel p { margin-bottom: 1rem; font-size: 0.875rem; }

.try-it-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.try-it-input-group { display: flex; flex-direction: column; gap: 0.25rem; }

.try-it-input-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.try-it-input-group input,
.try-it-input-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
}

.try-it-input-group input:focus,
.try-it-input-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.try-it-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.try-it-btn:hover { background: var(--primary-dark); }
.try-it-btn svg { width: 16px; height: 16px; }

/* Response block */
.response-block {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  display: none;
}

.response-block.visible { display: block; }

.response-header {
  background: #334155;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.response-meta { display: flex; align-items: center; gap: 1rem; }

.response-status {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.response-status.success { background: #dcfce7; color: #166534; }
.response-status.error { background: #fee2e2; color: #991b1b; }
.response-time { font-size: 0.75rem; color: #94a3b8; }

.response-body { background: #1e293b; padding: 1rem; overflow-x: auto; }
.response-body pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: #e2e8f0;
  margin: 0;
}

/* Error block */
.error-block { border-left: 3px solid #ef4444; }

/* API Key Input */
.api-key-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.api-key-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-key-section h4 svg { width: 16px; height: 16px; color: var(--primary); }
.api-key-input-wrapper { display: flex; gap: 0.5rem; }

.api-key-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.15s;
}

.api-key-input:focus { outline: none; border-color: var(--primary); }
.api-key-input::placeholder { color: var(--text-muted); }

.api-key-toggle {
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.api-key-toggle:hover { border-color: var(--primary); color: var(--primary); }
.api-key-toggle svg { width: 20px; height: 20px; }

.api-key-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.api-key-status.valid { color: var(--text-success); }
.api-key-status.invalid { color: #dc2626; }

/* Coming soon */
.coming-soon {
  background: var(--bg-code);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.coming-soon h3 { color: var(--text-muted); margin-bottom: 0.5rem; }
.coming-soon p { margin: 0; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.15s;
}

.card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.1); }

.card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.card-icon { width: 24px; height: 24px; color: var(--primary); }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.sidebar-overlay.active { display: block; }

/* Mobile responsive */
@media (max-width: 768px) {
  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }

  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .main { margin-left: 0; padding: 1.5rem 1rem; max-width: 100%; overflow-x: hidden; width: 100%; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }

  /* Base URL responsive */
  .base-url {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    word-break: break-all;
  }
  .base-url-value { font-size: 0.8rem; }

  /* Endpoint badge responsive */
  .endpoint {
    flex-wrap: wrap;
    word-break: break-all;
  }
  .endpoint-path { font-size: 0.8rem; }

  /* Tables responsive - horizontal scroll */
  .params-table { font-size: 0.8125rem; display: block; overflow-x: auto; white-space: nowrap; }
  .params-table th, .params-table td { padding: 0.5rem 0.75rem; }

  /* Code blocks responsive */
  .code-block { margin: 0.75rem 0; }
  .code-content { padding: 0.75rem; }
  .code-content pre { font-size: 0.75rem; white-space: pre-wrap; word-break: break-all; }

  /* Try it inputs responsive */
  .try-it-inputs { grid-template-columns: 1fr; }

  /* API Key section responsive */
  .api-key-section { padding: 1rem; }
  .api-key-input-wrapper { flex-direction: column; gap: 0.5rem; }
  .api-key-input { width: 100%; }
  .api-key-toggle { align-self: flex-start; }

  /* Content sections responsive */
  .content section { margin-bottom: 2.5rem; }
  .content h2 { font-size: 1.25rem; }
  .content h3 { font-size: 1rem; }
  .content h4 { font-size: 0.875rem; }

  /* Sidebar links responsive */
  .sidebar .endpoint-path { font-size: 0.75rem; }
  .sidebar .method-badge { font-size: 0.625rem; padding: 0.125rem 0.375rem; }
}

/* Syntax highlighting */
.keyword { color: #c084fc; }
.string { color: #86efac; }
.property { color: #7dd3fc; }
.number { color: #fcd34d; }

/* Medium screens (tablets) */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar { width: 260px; }
  .main { padding: 2rem 2.5rem; }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  .header { padding: 0.75rem 1rem; }
  .main { padding: 1rem 0.75rem; }
  .hero h1 { font-size: 1.25rem; }
  .hero { margin-bottom: 2rem; padding-bottom: 2rem; }

  .base-url { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .base-url-label { font-size: 0.625rem; }
  .base-url-value { font-size: 0.7rem; }

  .endpoint { padding: 0.375rem 0.75rem; gap: 0.5rem; }
  .method { font-size: 0.625rem; padding: 0.1875rem 0.375rem; }
  .endpoint-path { font-size: 0.7rem; }

  .code-content pre { font-size: 0.7rem; }
  .code-header span { font-size: 0.625rem; }
  .code-tab-btn { padding: 0.375rem 0.625rem; font-size: 0.625rem; }

  .response-tabs-nav { gap: 0.25rem; padding-bottom: 0.25rem; }
  .response-tab-btn { padding: 0.375rem 0.5rem; font-size: 0.75rem; }

  .params-table th, .params-table td { padding: 0.375rem 0.5rem; font-size: 0.75rem; }

  .try-it-btn { padding: 0.5rem 1rem; font-size: 0.8125rem; }
  .try-it-input-group label { font-size: 0.6875rem; }
  .try-it-input-group input, .try-it-input-group select { padding: 0.375rem 0.5rem; font-size: 0.8125rem; }

  .card-grid { grid-template-columns: 1fr; gap: 1rem; }
  .card { padding: 1rem; }
}
