/* Nestr MCP Landing Page Styles */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --background: #ffffff;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--primary);
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--primary);
}

/* Hero */
.hero {
  padding-top: 5em;
  padding-bottom: 8em;
  text-align: center;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary) 20%, var(--background) 100%);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--text);
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 700px;
  margin: 0 auto 24px;
}

.hero .subtitle a {
  color: var(--primary);
  text-decoration: none;
}

.hero .subtitle a:hover {
  text-decoration: underline;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.cta-buttons .btn {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Teach Agent Section */
.teach-agent {
  padding: 0 0 60px;
  background: var(--secondary);
}

.teach-agent-box {
  background: var(--background);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.12);
  border: 2px solid var(--primary);
  text-align: center;
}

.teach-agent-box h2 {
  margin-bottom: 12px;
  font-size: 1.75rem;
}

.teach-agent-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.teach-agent-card {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.teach-agent-instruction {
  flex: 1;
  min-width: 0;
}

.teach-agent-instruction code {
  color: #22c55e;
  font-size: 0.95rem;
  word-break: break-all;
}

.teach-agent-instruction a {
  color: #22c55e;
  text-decoration: underline;
}

.teach-agent-instruction a:hover {
  color: #4ade80;
}

.copy-skill-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.skill-copy-feedback {
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 500;
}

.teach-agent-steps {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.teach-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  max-width: 280px;
  font-size: 0.9rem;
  color: var(--text);
}

.teach-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.teach-agent-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.teach-agent-note a {
  color: var(--primary);
  text-decoration: none;
}

.teach-agent-note a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .teach-agent-box {
    padding: 24px;
  }

  .teach-agent-card {
    flex-direction: column;
    text-align: center;
  }

  .teach-agent-steps {
    flex-direction: column;
    align-items: center;
  }
}

/* About Section */
.about {
  padding: 60px 0 60px;
  background: var(--secondary);
}

.about-box {
  background: var(--background);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.about h2 {
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.about-text {
  max-width: 100%;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: center;
}

.about-text:last-child {
  margin-bottom: 0;
}

.about-text a {
  color: var(--primary);
  text-decoration: none;
}

.about-text a:hover {
  text-decoration: underline;
}

/* Features */
.features {
  padding: 40px 0;
  background: var(--secondary);
}

.features h2 {
  text-align: center;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.feature {
  text-align: center;
  padding: 16px;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature h3 {
  margin-bottom: 8px;
}

.feature p {
  color: var(--text);
  font-size: 0.95rem;
}

/* Setup */
.setup {
  padding: 60px 0;
  background: var(--secondary);
}

.setup h2 {
  text-align: center;
  margin-bottom: 48px;
}

.step {
  display: flex;
  gap: 24px;
  margin-bottom: 48px;
  background: var(--background);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  scroll-margin-top: 80px;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  margin-bottom: 16px;
}

.step-content ol, .step-content ul:not(.example-queries) {
  margin-left: 20px;
  margin-bottom: 16px;
}

.step-content li {
  margin-bottom: 8px;
}

.warning {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.tip {
  background: #e0f2fe;
  border-left: 4px solid #0ea5e9;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 16px;
}

.quickstart-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid var(--success);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.quickstart-box h4 {
  color: #166534;
  margin-bottom: 8px;
  font-size: 1rem;
}

.quickstart-box p {
  margin-bottom: 12px;
}

.quickstart-box pre {
  margin: 12px 0;
}

.quickstart-box .quickstart-note {
  font-size: 0.9rem;
  color: #166534;
  margin-bottom: 0;
  font-style: italic;
}

.token-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.token-btn {
  white-space: nowrap;
}

.token-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Auth Options */
.auth-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.auth-option {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}

.auth-option:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.auth-option.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0f0ff 0%, #fff 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.auth-option h4 {
  margin: 0;
  font-size: 1.1rem;
}

.auth-option > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* Auth Details Section */
.auth-details {
  margin-top: 20px;
  padding: 20px;
  background: var(--secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.auth-details:has(.auth-detail.active:empty) {
  display: none;
}

.auth-detail {
  display: none;
}

.auth-detail.active {
  display: block;
}

.auth-detail ol, .auth-detail ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.auth-detail li {
  margin-bottom: 8px;
}

.auth-detail p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.oauth-login-section {
  text-align: center;
  padding: 20px;
  margin: 16px 0;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 8px;
}

.oauth-btn {
  display: inline-block;
  font-size: 1rem;
}

.oauth-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Setup Options */
.setup-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.setup-option {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}

.setup-option:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.setup-option.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f0f0ff 0%, #fff 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.option-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.option-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.option-badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setup-option > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.option-pros {
  list-style: none;
  margin: 0;
  padding: 0;
}

.option-pros li {
  font-size: 0.85rem;
  color: var(--text);
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}

.option-pros li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

/* Field table (for Raycast manual setup) */
.field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--code-bg);
  border-radius: 8px;
  overflow: hidden;
}

.field-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--code-text);
}

.field-table tr:last-child td {
  border-bottom: none;
}

.field-table td:first-child {
  width: 140px;
  color: var(--text-muted);
}

.field-table code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Keyboard shortcut styling */
kbd {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Config blocks (show/hide based on setup method selection) */
.config-block {
  display: none;
}

.config-block.active {
  display: block;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
}

.tab.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

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

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

code {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.9rem;
}

p code, li code {
  background: var(--secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-dark);
}

/* Examples */
.examples {
  padding: 60px 0;
}

.examples h2 {
  text-align: center;
  margin-bottom: 48px;
}

.example {
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.user-message, .ai-message {
  padding: 20px;
}

.user-message {
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
}

.ai-message ul {
  margin-left: 20px;
  margin-top: 8px;
}

.example-queries {
  list-style: none;
  margin-left: 0;
  margin-top: 24px;
  padding-left: 0;
}

.example-queries li {
  padding: 8px 12px;
  background: var(--secondary);
  border-radius: 6px;
  margin-bottom: 8px;
  font-style: italic;
}

/* Tools */
.tools {
  padding: 60px 0;
  background: var(--secondary);
}

.tools h2 {
  text-align: center;
  margin-bottom: 32px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.tool {
  background: var(--background);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tool code {
  display: block;
  color: var(--primary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.tool p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.tool-note {
  text-align: center;
  margin-top: 24px;
}

.tool-note a {
  color: var(--primary);
}

/* Support */
.support {
  padding: 60px 0;
}

.support h2 {
  text-align: center;
  margin-bottom: 32px;
}

.support-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.support-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.support-link:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.support-icon {
  font-size: 2rem;
}

.support-link p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--primary);
}

/* Token Success (inline display after OAuth) */
.token-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid var(--success);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.token-success-header {
  color: #166534;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

.token-success p {
  color: #166534;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.token-display {
  display: flex;
  gap: 8px;
}

.token-display input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #86efac;
  border-radius: 6px;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 0.8rem;
  background: white;
}

.token-display .btn {
  flex-shrink: 0;
}

.copy-feedback {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Token placeholder in code blocks */
.token-placeholder {
  color: var(--text-muted);
}

.token-placeholder.token-filled {
  color: var(--success);
  font-weight: 500;
}

/* Fallback notes for one-click install */
.fallback-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

.fallback-note a {
  color: var(--primary);
  text-decoration: none;
}

.fallback-note a:hover {
  text-decoration: underline;
}

.manual-fallback {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.vscode-status {
  margin-top: 12px;
}

.vscode-status a {
  color: var(--primary);
}

/* Scope selector (Claude Code) */
.scope-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.scope-selector label {
  font-size: 0.9rem;
  white-space: nowrap;
}

.scope-selector select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: white;
  color: var(--text);
  cursor: pointer;
}

.scope-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 40px 0 30px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .about {
    padding: 12px 0 28px;
  }

  .about h2 {
    font-size: 1.25rem;
  }

  .about-text {
    font-size: 0.9rem;
  }

  .step {
    flex-direction: column;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  nav {
    gap: 16px;
  }

  .tabs {
    gap: 4px 6px;
  }

  .tab {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .auth-options,
  .setup-options {
    grid-template-columns: 1fr;
  }

  .token-display {
    flex-direction: column;
  }

  .token-display input {
    font-size: 0.75rem;
  }

  /* Field table mobile fixes */
  .field-table {
    display: block;
    width: 100%;
  }

  .field-table tbody {
    display: block;
  }

  .field-table tr {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .field-table tr:last-child {
    border-bottom: none;
  }

  .field-table td {
    display: block;
    padding: 0;
    border-bottom: none;
    width: 100% !important;
  }

  .field-table td:first-child {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .field-table td:last-child {
    font-size: 0.85rem;
  }

  .field-table code {
    word-break: break-all;
  }
}
