@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1523;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 38, 60, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-hover: rgba(56, 189, 248, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'Fira Code', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

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

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.9);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 0.85rem 1.25rem;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-links .nav-highlight {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* CONTAINER */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  box-sizing: border-box;
}

/* HERO SECTION */
.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.hero h1 span.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* SECTION HEADINGS */
.section-header {
  margin-bottom: 2rem;
  text-align: left;
  width: 100%;
}

.section-header.text-center {
  text-align: center;
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
  display: block;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.section-desc {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* GITHUB SHOWCASE STAGE */
.gh-showcase-stage {
  width: 100%;
  max-width: 940px;
  margin: 0 auto 1.25rem;
  background: #00030a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 35px rgba(6, 182, 212, 0.15);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.gh-showcase-stage:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.8), 0 0 45px rgba(6, 182, 212, 0.25);
}

.gh-showcase-stage img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.robot-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  width: 100%;
}

.robot-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.robot-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.robot-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  color: #38bdf8;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.preset-pills {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  width: 100%;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* CARDS AND PANELS */
.glass-panel {
  width: 100%;
  max-width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  overflow: hidden;
}

/* SEARCH & FILTER BAR */
.search-bar-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  color: var(--text-dim);
  pointer-events: none;
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  background: rgba(15, 21, 35, 0.9);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem 0.9rem 3.1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  width: 100%;
}

.search-count {
  font-weight: 600;
  color: var(--accent-cyan);
}

/* ICONS GRID */
.icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  width: 100%;
}

.icon-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.65rem;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  min-width: 0;
  box-sizing: border-box;
}

.icon-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--bg-card-border-hover);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.icon-card .icon-img-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}

.icon-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.icon-card .icon-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* PLAYGROUND / GENERATORS */
.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

.playground-grid > div {
  min-width: 0;
  max-width: 100%;
}

.form-group {
  margin-bottom: 1.1rem;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  max-width: 100%;
  background: rgba(10, 14, 22, 0.85);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.form-row > div {
  min-width: 0;
}

.preview-box {
  background: #06090f;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.preview-box.checker-bg {
  background-image: 
    linear-gradient(45deg, #121824 25%, transparent 25%), 
    linear-gradient(-45deg, #121824 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #121824 75%), 
    linear-gradient(-45deg, transparent 75%, #121824 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.preview-box img {
  max-width: 100%;
  height: auto;
}

/* CODE BLOCKS AND COPY BUTTONS - STRICTLY PREVENTS HORIZONTAL BLOWOUT */
.code-block-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.code-block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #05070d;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 4.5rem 0.85rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  white-space: nowrap;
  display: block;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.code-block::-webkit-scrollbar {
  height: 4px;
}
.code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.copy-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  z-index: 2;
}

.copy-btn:hover {
  background: var(--accent-cyan);
  color: #ffffff;
  border-color: var(--accent-cyan);
}

/* TOAST NOTIFICATION */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* RESPONSIVE TABLE CONTAINER */
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  box-sizing: border-box;
}

.api-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.api-table th {
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--bg-card-border);
}

.api-table td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.api-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* FOOTER */
.footer {
  margin-top: 4.5rem;
  padding: 2.5rem 1.25rem;
  border-top: 1px solid var(--bg-card-border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  width: 100%;
}

.footer a {
  color: var(--accent-cyan);
}

/* COMPREHENSIVE RESPONSIVE STYLES */
@media (max-width: 900px) {
  .playground-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .icons-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.85rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 1.5rem 0.85rem;
  }
  .hero {
    padding: 2rem 0.5rem 1.5rem;
  }
  .hero h1 {
    font-size: 1.85rem;
  }
  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  .glass-panel {
    padding: 1.25rem 0.9rem;
    border-radius: var(--radius-md);
  }
  .robot-switcher {
    gap: 0.35rem;
  }
  .robot-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
  }
  .icons-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 0.65rem;
  }
  .icon-card {
    padding: 0.85rem 0.45rem;
  }
  .icon-card .icon-img-wrap {
    width: 42px;
    height: 42px;
  }
  .code-block {
    font-size: 0.75rem;
    padding-right: 4.2rem;
  }
  .copy-btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }
}