/**
 * CodeConfig Demo Site - Frontend Enhancements Stylesheet
 * Enqueued after main.css to provide brand consistency, responsive polish, and accessible UI.
 */

:root {
  --cc-primary: #0061fe;
  --cc-primary-dark: #0050d4;
  --cc-primary-light: #e0f5ff;
  --cc-green: #00ac47;
  --cc-navy: #000d23;
  --cc-slate: #3c4770;
  --cc-slate-light: #64748b;
  --cc-lime: #e1f2a6;
  --cc-bg-light: #f8fafd;
  --cc-card-bg: #ffffff;
  --cc-border: #e2e8f0;
  --cc-border-light: #edf2f7;
  --cc-radius-sm: 8px;
  --cc-radius-md: 12px;
  --cc-radius-lg: 16px;
  --cc-shadow-sm: 0 2px 8px rgba(0, 13, 35, 0.04);
  --cc-shadow-md: 0 8px 24px rgba(0, 13, 35, 0.06);
  --cc-shadow-lg: 0 16px 40px rgba(0, 13, 35, 0.08);
}

/* Accessibility & Focus Rings */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Header Enhancements
   -------------------------------------------------------------------------- */
body:not(.igd-page):not(.idb-page) #cc-header {
  background: #ffffff;
  border-bottom: 1px solid var(--cc-border-light);
  transition: all 0.25s ease;
}

body.igd-page #cc-header {
  background: transparent !important;
  border-bottom: none !important;
}

/* main.js already puts the admin bar's height into --header-top-space (admin bar + announcement bar), and
   main.css uses it as the header's `top`. Adding the admin bar height again here pushed the header a second
   32px (46px on phones) down for logged-in admins. The values below are only the no-JS fallback. */
body.admin-bar #cc-header {
  top: var(--header-top-space, 32px) !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar #cc-header {
    top: var(--header-top-space, 46px) !important;
  }
}

.header-menu-wrap {
  min-height: 72px;
  width: 100%;
}

.header-action-wrap {
  gap: 12px;
}

.demo-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  min-height: 44px;
  background-color: var(--cc-primary);
  color: #ffffff !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--cc-radius-sm);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.demo-header-cta:hover {
  background-color: var(--cc-primary-dark);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 97, 254, 0.25);
}

.demo-header-cta:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Hero Section: Demo Sandbox Landing
   -------------------------------------------------------------------------- */
.cc-hero-sandbox {
  position: relative;
  background: linear-gradient(180deg, #f8fafd 0%, #eef5ff 100%);
  padding: 96px 0 80px;
  text-align: center;
  border-bottom: 1px solid var(--cc-border);
  overflow: hidden;
}

.cc-hero-sandbox::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 480px;
  background: radial-gradient(circle, rgba(224, 245, 255, 0.8) 0%, rgba(248, 250, 253, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.cc-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.cc-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background-color: #ffffff;
  border: 1px solid #d0e4ff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-primary);
  margin-bottom: 24px;
  box-shadow: var(--cc-shadow-sm);
}

.cc-badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--cc-green);
  border-radius: 50%;
  display: inline-block;
}

.cc-hero-title {
  font-size: 46px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.cc-hero-subtitle {
  font-size: 19px;
  line-height: 1.6;
  color: var(--cc-slate);
  margin: 0 auto 32px;
  max-width: 660px;
}

.cc-hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.cc-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--cc-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.cc-btn-primary {
  background-color: var(--cc-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 97, 254, 0.3);
}

.cc-btn-primary:hover {
  background-color: var(--cc-primary-dark);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 97, 254, 0.4);
}

.cc-btn-secondary {
  background-color: #ffffff;
  color: var(--cc-navy) !important;
  border: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow-sm);
}

.cc-btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--cc-navy) !important;
  transform: translateY(-1px);
}

.cc-hero-perks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 14px;
  color: var(--cc-slate);
  flex-wrap: wrap;
}

.cc-perk-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cc-perk-item svg {
  color: var(--cc-green);
  flex-shrink: 0;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
}

/* --------------------------------------------------------------------------
   Available Demos Section
   -------------------------------------------------------------------------- */
.cc-section-demos {
  padding: 80px 0;
  background-color: #ffffff;
}

.cc-section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 52px;
}

.cc-section-tag {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-primary);
  margin-bottom: 12px;
  display: block;
}

.cc-section-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.cc-section-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--cc-slate);
  margin: 0;
}

.cc-demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.cc-demo-card {
  background-color: var(--cc-card-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 36px 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--cc-shadow-sm);
  position: relative;
}

.cc-demo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cc-shadow-md);
  border-color: #c7d9fc;
}

.cc-card-top {
  margin-bottom: 24px;
}

.cc-card-icon-wrap {
  width: 52px;
  height: 52px;
  background-color: var(--cc-primary-light);
  border-radius: var(--cc-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--cc-primary);
}

.cc-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0 0 12px;
}

.cc-card-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cc-slate);
  margin: 0 0 20px;
}

.cc-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

.cc-card-features li {
  font-size: 14px;
  color: var(--cc-slate);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-card-icon-wrap svg {
  width: 28px !important;
  height: 28px !important;
}

.cc-card-features li svg {
  color: var(--cc-green);
  flex-shrink: 0;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
}

.cc-card-action {
  width: 100%;
}

.cc-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  min-height: 46px;
  background-color: var(--cc-primary-light);
  color: var(--cc-primary) !important;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--cc-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.cc-card-btn:hover {
  background-color: var(--cc-primary);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   How It Works Section
   -------------------------------------------------------------------------- */
.cc-section-steps {
  padding: 80px 0;
  background-color: var(--cc-bg-light);
  border-top: 1px solid var(--cc-border-light);
  border-bottom: 1px solid var(--cc-border-light);
}

.cc-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.cc-step-card {
  background-color: #ffffff;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-md);
  padding: 32px 28px;
  box-shadow: var(--cc-shadow-sm);
  position: relative;
}

.cc-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--cc-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
  margin-bottom: 18px;
}

.cc-step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0 0 10px;
}

.cc-step-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--cc-slate);
  margin: 0;
}

/* --------------------------------------------------------------------------
   CTA Block: Request Sandbox
   -------------------------------------------------------------------------- */
.cc-sandbox-cta-wrap {
  padding: 80px 0;
  background-color: #ffffff;
}

.cc-sandbox-cta-box {
  background-color: var(--cc-navy);
  border-radius: var(--cc-radius-lg);
  padding: 56px 48px;
  text-align: center;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--cc-shadow-lg);
}

.cc-sandbox-cta-box::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(0, 97, 254, 0.4) 0%, rgba(0, 13, 35, 0) 70%);
  pointer-events: none;
}

.cc-cta-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 14px;
}

.cc-cta-desc {
  font-size: 16px;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto 28px;
}

/* --------------------------------------------------------------------------
   404 Page Template
   -------------------------------------------------------------------------- */
.cc-404-container {
  padding: 100px 0;
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cc-bg-light);
}

.cc-404-card {
  max-width: 560px;
  width: 100%;
  background-color: #ffffff;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 52px 40px;
  text-align: center;
  box-shadow: var(--cc-shadow-md);
  margin: 0 auto;
}

.cc-404-code {
  display: inline-block;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--cc-primary);
  margin-bottom: 12px;
  letter-spacing: -0.04em;
}

.cc-404-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0 0 14px;
}

.cc-404-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cc-slate);
  margin: 0 auto 28px;
}

.cc-404-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Generic Page (page.php)
   -------------------------------------------------------------------------- */
.cc-page-hero-banner {
  background: linear-gradient(180deg, #f8fafd 0%, #ffffff 100%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--cc-border-light);
  margin-bottom: 48px;
}

.cc-page-hero-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 0;
  letter-spacing: -0.02em;
}

.cc-default-content {
  font-size: 16px;
  line-height: 1.75;
  color: #1e293b;
  max-width: 840px;
  margin: 0 auto 64px;
}

.cc-default-content p {
  margin-bottom: 1.5em;
}

.cc-default-content h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 2em 0 0.8em;
}

.cc-default-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-navy);
  margin: 1.8em 0 0.6em;
}

/* --------------------------------------------------------------------------
   Footer Empty Menu Cleanup
   -------------------------------------------------------------------------- */
.footer-menu:empty {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .cc-steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cc-hero-title {
    font-size: 38px;
  }
}

@media (max-width: 768px) {
  .cc-hero-sandbox {
    padding: 64px 0 52px;
  }
  .cc-hero-title {
    font-size: 32px;
  }
  .cc-hero-subtitle {
    font-size: 17px;
  }
  .cc-section-demos,
  .cc-section-steps,
  .cc-sandbox-cta-wrap {
    padding: 56px 0;
  }
  .cc-sandbox-cta-box {
    padding: 40px 24px;
  }
  .cc-cta-title {
    font-size: 26px;
  }
  .cc-404-container {
    padding: 64px 0;
  }
  .cc-404-card {
    padding: 36px 20px;
  }
}

@media (max-width: 480px) {
  .header-menu-wrap {
    min-height: 64px;
  }
  .cc-hero-title {
    font-size: 26px;
    line-height: 1.25;
  }
  .cc-hero-subtitle {
    font-size: 15px;
  }
  .demo-header-cta {
    padding: 8px 16px;
    font-size: 14px;
  }
  .cc-hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  .cc-btn-hero {
    width: 100%;
  }
  .cc-hero-perks {
    flex-direction: column;
    gap: 12px;
  }
  .cc-404-actions {
    flex-direction: column;
    width: 100%;
  }
  .cc-404-actions a {
    width: 100%;
  }
}

/* ==========================================================================
   Product demo root page: feature cards, sandbox scope, request section
   ========================================================================== */

.cc-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.cc-feature-card {
  display: flex;
  flex-direction: column;
  background: var(--cc-card-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 28px 26px;
  box-shadow: var(--cc-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cc-feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--cc-primary);
  box-shadow: var(--cc-shadow-md);
}

.cc-feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: var(--cc-radius-md);
  background: var(--cc-primary-light);
  color: var(--cc-primary);
}

.cc-feature-card__title {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--cc-navy);
}

.cc-feature-card__text {
  flex: 1;
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cc-slate-light);
}

.cc-feature-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cc-primary);
  text-decoration: none;
}

.cc-feature-card__link:hover {
  color: var(--cc-primary-dark);
  gap: 10px;
}

.cc-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 920px;
  margin: 0 auto;
}

.cc-scope-card {
  background: var(--cc-card-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 28px 28px 24px;
}

.cc-scope-card__title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--cc-navy);
}

.cc-scope-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cc-scope-card li {
  position: relative;
  padding: 0 0 10px 28px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-slate);
}

.cc-scope-card li::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  text-align: center;
  font-weight: 700;
}

.cc-scope-card--yes { border-top: 3px solid var(--cc-green); }
.cc-scope-card--yes li::before { content: "✓"; color: var(--cc-green); }
.cc-scope-card--no { border-top: 3px solid #cbd5e1; }
.cc-scope-card--no li::before { content: "–"; color: var(--cc-slate-light); }

.cc-section-request {
  padding: 40px 0 96px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
}

@media (max-width: 720px) {
  .cc-scope-grid { grid-template-columns: 1fr; }
}

/* The theme gives every <section> an 80px block margin; these bands are full-bleed
   and butt against each other, so the margin would only open gaps between them. */
.cc-hero-sandbox,
.cc-section-demos,
.cc-section-steps,
.cc-section-request,
.cc-sandbox-cta-wrap {
  margin-block: 0;
}

/* --------------------------------------------------------------------------
   Home page, built from the features page
   -------------------------------------------------------------------------- */
.cc-home-anchor {
  scroll-margin-top: 110px;
}

/* The perks strip sits directly under the features-page hero. */
.cc-home-perks {
  /* pull it up into the hero's bottom padding + the theme's section margin, which together leave a big gap */
  margin: calc(-1 * clamp(3.125rem, 6.5vw, 5rem) + 12px) 0 0;
  padding: 0 0 clamp(24px, 4vw, 48px);
  position: relative;
  z-index: 1;
}

/* Feature card screenshot: off by default, a product stylesheet (idb.css) turns it on. */
.demo-feature__wrapper__item__media {
  display: none;
}
