/* ========================================
   MOLFORGE — SHARED STYLES FOR SOLUTIONS,
   PRICING, DOCS PAGES
   Variables from theme.css
   ======================================== */

/* ========================================
   PAGE HERO (smaller than landing)
   ======================================== */
.page-hero {
  padding: 7rem 1rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero .breadcrumb {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.page-hero .breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.page-hero .breadcrumb a:hover {
  text-decoration: underline;
}

.page-hero .breadcrumb .separator {
  opacity: 0.5;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--hero-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 4s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.page-hero p {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-light);
  line-height: 1.7;
}

.hero-image {
  max-width: 720px;
  margin: 2rem auto 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--card-border);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-hero .subtitle {
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========================================
   SECTION
   ======================================== */
.section {
  padding: 4rem 0;
}

.section-alt {
  padding: 4rem 0;
  background: linear-gradient(180deg, var(--background) 0%, var(--surface) 100%);
}

.section h2,
.section-alt h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-alt > .container > p.section-desc {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  color: var(--text-light);
  font-size: 1rem;
}

.section-desc,
.section > .container > p.section-desc {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  color: var(--text-light);
  font-size: 1rem;
}

/* ========================================
   PERSONA / SOLUTION CARDS
   ======================================== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.card:hover::before {
  opacity: var(--card-hover-opacity);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--glow);
  border-color: var(--primary);
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-icon {
  display: none;
}

.card-visual {
  aspect-ratio: 16 / 9;
  margin: -2rem -2rem 1.25rem;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #f0f2f5;
  max-height: 180px;
}

@media (min-width: 992px) {
  .card-visual {
    max-height: none;
  }
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-visual img {
  transform: scale(1.05);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.card p {
  color: var(--text-light);
  line-height: 1.7;
  font-size: 0.95rem;
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.3s ease;
}

.card .card-link:hover {
  gap: 0.75rem;
}

/* ========================================
   PRICING TOGGLE
   ======================================== */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.pricing-toggle span {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
  transition: color 0.3s;
}

.pricing-toggle span.active {
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--card-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
  padding: 0;
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch.active::after {
  transform: translateX(24px);
}

.pricing-badge {
  background: var(--success);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
}

/* ========================================
   PRICING CARDS
   ======================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.pricing-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-border);
  transition: background 0.3s;
}

.pricing-card.popular {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), var(--glow);
  z-index: 2;
}

@media (min-width: 768px) {
  .pricing-card.popular {
    transform: scale(1.03);
  }
}

.pricing-card.popular::before {
  height: 4px;
  background: var(--gradient);
}

.pricing-card.popular .popular-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 1.5rem;
  border-radius: 0 0 10px 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), var(--glow);
  border-color: var(--primary);
}

.pricing-card.popular:hover {
  transform: translateY(-6px);
}

@media (min-width: 768px) {
  .pricing-card.popular:hover {
    transform: scale(1.03) translateY(-6px);
  }
}

.pricing-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pricing-card .price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0.75rem 0 0.25rem;
  line-height: 1;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-light);
}

.pricing-card .price-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  min-height: 2.5em;
}

.pricing-card .feature-list {
  list-style: none;
  padding: 0;
  text-align: left;
  margin-bottom: 2rem;
  flex: 1;
}

.pricing-card .feature-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: var(--text-light);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--glass-border);
}

.pricing-card .feature-list li:first-child {
  font-weight: 600;
  color: var(--text);
}

.pricing-card .feature-list li:last-child {
  border-bottom: none;
}

.pricing-card .feature-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.pricing-card .feature-list li:first-child::before {
  content: '';
}

.pricing-card .feature-list li.disabled {
  opacity: 0.4;
}

.pricing-card .feature-list li.disabled::before {
  content: '\2717';
  color: var(--text-light);
}

.pricing-card .cta-button {
  width: 100%;
  display: block;
  text-align: center;
  margin-top: auto;
}

.pricing-card .cta-button.cta-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.pricing-card .cta-button.cta-outline:hover {
  background: var(--card-bg);
  box-shadow: var(--glow);
}

/* ========================================
   FEATURE COMPARISON TABLE
   ======================================== */
.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  position: relative;
}

/* Scroll hint on mobile */
@media (max-width: 767px) {
  .comparison-table-wrap::after {
    content: '← swipe →';
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 0.5rem;
    opacity: 0.7;
  }
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 700px;
}

@media (max-width: 575px) {
  .comparison-table {
    min-width: 500px;
    font-size: 0.8rem;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 0.625rem 0.5rem;
  }
}

.comparison-table th,
.comparison-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.comparison-table th {
  background: var(--card-bg);
  font-weight: 700;
  color: var(--text);
  position: sticky;
  top: 0;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  left: 0;
  background: var(--card-bg);
  z-index: 1;
}

.comparison-table td {
  color: var(--text-light);
}

.comparison-table tbody tr:hover {
  background: var(--hover-overlay-subtle);
}

.comparison-table .check {
  color: var(--success);
  font-weight: bold;
}

.comparison-table .cross {
  color: var(--text-light);
  opacity: 0.4;
}

/* ========================================
   TABS (for sub-segments)
   ======================================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.tab-btn {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--cta-glow);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   CODE BLOCKS
   ======================================== */
.code-block {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-header .lang-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-header .copy-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #8b949e;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.code-header .copy-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e6edf3;
}

/* Syntax colors */
.code-block .kw { color: #ff7b72; }
.code-block .str { color: #a5d6ff; }
.code-block .fn { color: #d2a8ff; }
.code-block .cm { color: #8b949e; }
.code-block .num { color: #79c0ff; }
.code-block .op { color: #ff7b72; }

/* ========================================
   ACCORDION (API endpoints, FAQ)
   ======================================== */
.accordion {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.accordion-item {
  border-bottom: 1px solid var(--glass-border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.accordion-trigger:hover {
  background: var(--hover-overlay-subtle);
}

.accordion-trigger .method {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.accordion-trigger .method.get { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.accordion-trigger .method.post { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.accordion-trigger .method.put { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.accordion-trigger .method.delete { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.accordion-trigger .chevron {
  transition: transform 0.3s;
  font-size: 0.8rem;
  color: var(--text-light);
}

.accordion-item.open .accordion-trigger .chevron {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 1.25rem;
  background: var(--glass-bg);
}

.accordion-item.open .accordion-content {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ========================================
   BADGES & PILLS
   ======================================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--accent-bg);
  color: var(--primary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* ========================================
   CTA SECTION (reusable)
   ======================================== */
.page-cta {
  padding: 4rem 0;
  background: var(--cta-section-bg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-cta::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, var(--cta-pulse) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.page-cta .container {
  position: relative;
  z-index: 1;
}

.page-cta h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.page-cta p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-light);
}

.page-cta .cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   CTA BUTTON (reuse from landing)
   ======================================== */
.cta-button {
  background: var(--gradient);
  color: var(--text-on-gradient);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: var(--cta-glow);
  white-space: nowrap;
  display: inline-block;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--cta-glow-hover);
}

.cta-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.cta-outline:hover {
  background: var(--card-bg);
  box-shadow: var(--glow);
}

/* ========================================
   STAT COUNTERS
   ======================================== */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat .label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ========================================
   USE CASE LIST
   ======================================== */
.use-case-list {
  list-style: none;
  padding: 0;
}

.use-case-list li {
  padding: 0.625rem 0;
  padding-left: 2rem;
  position: relative;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.use-case-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
  font-size: 1rem;
}

/* ========================================
   SPLIT LAYOUT (text + code/image)
   ======================================== */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.split h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.split p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ========================================
   SECURITY BADGES ROW
   ======================================== */
.security-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.security-badge i {
  color: var(--success);
}

/* ========================================
   CREDIT PACKAGES
   ======================================== */
.credit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.credit-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s;
}

.credit-card:hover {
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.credit-card .amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.credit-card .credits {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.credit-card .per-credit {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 576px) {
  .page-hero h1 {
    font-size: 3rem;
  }

  .credit-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .page-hero {
    padding: 8rem 2rem 4rem;
  }

  .page-hero h1 {
    font-size: 3.5rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split {
    grid-template-columns: 1fr 1fr;
  }

  .section, .section-alt {
    padding: 6rem 0;
  }

  .section h2, .page-cta h2 {
    font-size: 2.5rem;
  }

  .credit-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1200px) {
  .card-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
  }

  .credit-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
