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

:root {
  --bg-obsidian: hsl(224, 25%, 5%);
  --bg-card: hsla(224, 20%, 9%, 0.65);
  --bg-card-hover: hsla(224, 20%, 12%, 0.85);
  --bg-input: hsl(224, 18%, 12%);
  --border-color: hsla(224, 15%, 16%, 0.7);
  --border-color-active: hsl(258, 90%, 66%);
  
  --primary: hsl(258, 90%, 66%);
  --primary-glow: hsla(258, 90%, 66%, 0.15);
  --secondary: hsl(187, 92%, 45%);
  --secondary-glow: hsla(187, 92%, 45%, 0.15);
  --accent: hsl(325, 90%, 55%);
  
  --text-main: hsl(220, 15%, 90%);
  --text-muted: hsl(220, 10%, 60%);
  --text-glow: hsl(220, 20%, 98%);
  
  --success: hsl(142, 76%, 45%);
  --danger: hsl(350, 89%, 60%);
  
  --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Background Gradients */
.glow-bg {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
}

.glow-purple {
  background: var(--primary);
  top: -10%;
  left: -10%;
}

.glow-teal {
  background: var(--secondary);
  bottom: -10%;
  right: -10%;
}

/* Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--bg-obsidian);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 10;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--primary-glow);
}

.brand-logo svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--text-glow), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sidebar Navigation */
.nav-category {
  margin-bottom: 1.5rem;
}

.category-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  font-weight: 600;
}

.api-list {
  list-style: none;
}

.api-item {
  margin-bottom: 0.25rem;
}

.api-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--border-radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.api-link:hover {
  color: var(--text-main);
  background-color: var(--bg-card);
}

.api-link.active {
  color: #fff;
  background: linear-gradient(90deg, var(--primary-glow), transparent);
  border-left: 3px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.api-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.api-link.active svg {
  opacity: 1;
  color: var(--secondary);
}

/* Main Dashboard Area */
.main-content {
  padding: 2rem;
  overflow-y: auto;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Header & Stats */
.dashboard-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.title-area h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 1rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 4px 20px var(--secondary-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--secondary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* Main Interactive Sandbox */
.sandbox-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .sandbox-grid {
    grid-template-columns: 1fr;
  }
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Glass Card Component */
.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 40px 0 rgba(139, 92, 246, 0.12), 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.7;
}

/* Playground Form Panel */
.panel-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Dynamic Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.input-container {
  position: relative;
}

.form-input, .form-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-color-active);
  box-shadow: 0 0 12px var(--primary-glow);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Slider Controls */
.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-range {
  flex: 1;
  accent-color: var(--primary);
  height: 6px;
  border-radius: 3px;
  cursor: pointer;
}

.slider-value {
  font-family: var(--font-code);
  font-size: 0.85rem;
  min-width: 25px;
  text-align: right;
}

/* Button & Action styling */
.action-buttons {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsl(258, 90%, 56%));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px hsla(258, 90%, 66%, 0.25);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(1px);
}

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

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

.btn-rapid {
  background: linear-gradient(135deg, var(--secondary), hsl(187, 92%, 35%));
  color: #fff;
  box-shadow: 0 4px 16px var(--secondary-glow);
  animation: pulse-button 3s infinite;
}

.btn-rapid:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px hsla(187, 92%, 45%, 0.4);
  filter: brightness(1.1);
  animation: none;
}

.btn-rapid:active {
  transform: translateY(1px);
}

.btn-rapid svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

@keyframes pulse-button {
  0% {
    box-shadow: 0 4px 16px var(--secondary-glow);
  }
  50% {
    box-shadow: 0 4px 25px hsla(187, 92%, 45%, 0.45);
  }
  100% {
    box-shadow: 0 4px 16px var(--secondary-glow);
  }
}

/* Console Header Tabs */
.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.tabs-list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: hsla(224, 15%, 15%, 0.4);
}

.tab-btn.active {
  color: var(--secondary);
  background-color: var(--bg-input);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.console-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  background-color: var(--border-color);
}

/* Console Display Box */
.console-body {
  position: relative;
  background-color: var(--bg-obsidian);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  height: 350px;
  overflow: auto;
  font-family: var(--font-code);
  font-size: 0.825rem;
  padding: 1.25rem;
}

/* Custom Image output style (for Barcode API) */
.console-img-output {
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-obsidian);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  height: 350px;
  overflow: auto;
  padding: 1.5rem;
}

.console-img-output img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: white;
  padding: 1rem;
}

/* JSON Formatting styles */
.json-key { color: hsl(275, 80%, 75%); }      /* purple */
.json-string { color: hsl(145, 60%, 65%); }   /* green */
.json-number { color: hsl(35, 85%, 65%); }    /* orange */
.json-boolean { color: hsl(200, 85%, 65%); }   /* blue */
.json-null { color: hsl(0, 70%, 65%); }       /* red */

pre code {
  color: var(--text-main);
}

/* Loading Overlay inside Console */
.loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(9, 15, 28, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Integration Details Footer */
.api-info-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.info-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-get {
  background-color: rgba(16, 185, 129, 0.15);
  color: hsl(142, 76%, 50%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-post {
  background-color: rgba(59, 130, 246, 0.15);
  color: hsl(217, 91%, 60%);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Search Box style */
.search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  color: var(--text-main);
  font-size: 0.825rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Tooltip animation */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: 'Copied!';
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

.tooltip.show::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Features Grid */
.features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feature-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 8px 24px var(--secondary-glow);
  transform: translateY(-2px);
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--secondary-glow);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-glow);
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* CTA conversion banner */
.cta-banner {
  background: linear-gradient(135deg, hsla(258, 90%, 12%, 0.5), hsla(187, 92%, 8%, 0.5));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  margin-top: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.cta-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.cta-desc {
  color: var(--text-muted);
  font-size: 0.925rem;
  max-width: 600px;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.btn-cta {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 0.95rem;
  padding: 0.8rem 2.25rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px var(--primary-glow);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: var(--transition-smooth);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px hsla(258, 90%, 66%, 0.35);
  filter: brightness(1.15);
}

@media (max-width: 768px) {
  .features-section {
    grid-template-columns: 1fr;
  }
  .cta-banner {
    padding: 2rem 1.25rem;
  }
  .cta-title {
    font-size: 1.4rem;
  }
}
