:root {
  --bg-dark: #070b14;
  --bg-card: rgba(13, 20, 36, 0.75);
  --bg-card-hover: rgba(18, 28, 51, 0.85);
  --cyan-primary: #00d8f6;
  --cyan-glow: rgba(0, 216, 246, 0.35);
  --green-accent: #10b981;
  --purple-accent: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(0, 216, 246, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 216, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
    linear-gradient(to bottom, rgba(7, 11, 20, 0.95), var(--bg-dark));
  background-attachment: fixed;
}

/* Nav Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.nav-logo-badge {
  font-size: 1.4rem;
  background: rgba(0, 216, 246, 0.12);
  border: 1px solid var(--cyan-primary);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 0 15px var(--cyan-glow);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  background: rgba(0, 216, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-accent);
  font-family: var(--font-mono);
}

.btn-signin, .btn-primary {
  background: linear-gradient(135deg, var(--cyan-primary) 0%, #0099ff 100%);
  color: #000;
  font-weight: 800;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 0 16px var(--cyan-glow);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-signin:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 216, 246, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  color: #fff;
  border-color: var(--border-color);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 0 60px 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(0, 216, 246, 0.1);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero h2 {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 32px auto;
}

/* One-Click Connect Box */
.connect-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  max-width: 760px;
  margin: 0 auto 48px auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.connect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.connect-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan-primary);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.code-snippet {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-all;
}

.btn-copy {
  background: rgba(0, 216, 246, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* Tool Marketplace Grid */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.tool-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 216, 246, 0.12);
  border: 1px solid rgba(0, 216, 246, 0.3);
  color: var(--cyan-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.tool-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 6px;
}

.tool-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 16px;
  line-height: 1.45;
  position: relative;
}

.tool-desc-text {
  transition: all 0.2s ease;
}

.tool-desc-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-read-more {
  background: none;
  border: none;
  color: var(--cyan-primary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
  display: inline-block;
  margin-top: 4px;
}

.btn-read-more:hover {
  text-decoration: underline;
  color: #fff;
}

.tool-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: auto;
}

.btn-test {
  flex: 1;
  background: rgba(0, 216, 246, 0.1);
  border: 1px solid rgba(0, 216, 246, 0.3);
  color: var(--cyan-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-test:hover {
  background: var(--cyan-primary);
  color: #000;
}

/* Modal Styling */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #0d131f;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 0 40px rgba(0, 216, 246, 0.25);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--cyan-primary);
  color: #000;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.btn-oauth:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan-primary);
}

.hidden {
  display: none !important;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  border: 1px solid var(--cyan-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 10000;
  display: none;
}
