:root {
  --demo-icon-color: #000000;
  --demo-icon-weight: 8px;
}

.demo-section {
  position: relative;
  width: 100%;
  min-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-direction: column;
  padding: 80px 20px;
  text-align: center;
}

.demo-header {
    max-width: 1180px;
    margin-bottom: 100px;
    margin-top: 50px;
}

.demo-heading {
    font-size: 48px;
    font-weight: 400;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
    color: #000;
    max-width: 900px;
}

.accent-blue {
    color: #006CFF;
    font-weight: 600;
}

.demo-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
}

.plugin-mockup {
  position: relative;
  width: 310px;
  height: 655px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  padding: 12px 8px 0;
  box-sizing: border-box;
  z-index: 2;
  font-family: 'Outfit', sans-serif;
  z-index: 0;
}

.pm-title-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px 10px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.pm-title-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.pm-title-logo svg { width: 100%; height: 100%; display: block; }

.pm-title-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 300;
  color: #16161a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  padding-right: 25px;
}

.pm-title-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #999;
  cursor: default;
  transition: color .2s;
}

.pm-top-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  padding-left: 4px; 
  padding-right: 4px;
}

.pm-header-controls {
  padding-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: default;
}

.pm-search-fake {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  color: rgba(0,0,0,0.4);
  border-radius: 4px;
  font-size: 11px;
}

.pm-btn-fake {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  color: rgba(0,0,0,0.4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pm-settings {
  display: flex;
  align-items: center;
  gap: 10px;
}

#demoWeightInput {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e5e5e5;
  outline: none;
  cursor: pointer;
}

/* Chrome, Safari, Edge */
#demoWeightInput::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0050FF;
  cursor: pointer;
}

/* Firefox */
#demoWeightInput::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0050FF;
  border: none;
  cursor: pointer;
}

.pm-value-label {
  font-size: 11px;
  color: #666;
  min-width: 28px;
  text-align: right;
  font-weight: 500;
}

#demoColorInput {
  width: 30px; 
  height: 30px; 
  border-radius: 50%; 
  border: 1px solid #e5e5e5;
  cursor: pointer; 
  padding: 0; 
  background: 0 0; 
  overflow: hidden; 
}
#demoColorInput::-webkit-color-swatch-wrapper { padding: 0; }
#demoColorInput::-webkit-color-swatch { border: none; border-radius: 50%; }

.pm-grid {
  display: grid;
  grid-template-columns: repeat(3, 86px);
  gap: 10px 8px;
  justify-content: center;
  padding-right: 4px;
  padding-bottom: 12px;
  flex-grow: 1;
  overflow: hidden;
  align-content: start;
}

.pm-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pm-icon-card {
  width: 86px;
  height: 86px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  cursor: pointer;
  box-sizing: border-box;
}

.pm-icon-card:hover {
  border-color: #0050FF;
  background: #F8FAFF;
}

.pm-icon-card svg {
  width: 68px;
  height: 68px;
  stroke: var(--demo-icon-color);
  stroke-width: var(--demo-icon-weight);
  fill: none;
  transition: stroke 0.3s ease;
}

.pm-icon-label {
  font-size: 9px;
  color: #999;
  text-align: center;
  width: 86px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 13px;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
  cursor: default;
}

.pm-footer p { 
  font-size: 11px; 
  color: #666;
  margin: 0; 
}

.pm-request-btn { 
  padding: 6px 12px; 
  border: 1px solid #0050FF; 
  color: #0050FF; 
  border-radius: 6px; 
  font-size: 11px; 
  font-weight: 500; 
}

.demo-lines-overlay {
  position: absolute;
  top: 52.4%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1000px;
  height: 600px;
  pointer-events: none;
  z-index: 1;
}

.animated-line {
  fill: none;
  stroke: #0050FF;
  stroke-width: 1.5;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  opacity: 0.8;
}

.animated-dot {
  opacity: 0;
}

.demo-tag {
  position: absolute;
  background: #0050FF;
  padding: 10px 20px;
  border-radius: 100px;
  font-family: 'Outfit', sans-serif;
  z-index: 3;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  white-space: nowrap;
}

.demo-tag span {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

.demo-tag p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #333;
}

.tag-l1 { top: calc(50% - 175px); right: calc(50% + 270px); }
.tag-l2 { top: calc(50% - 45px); right: calc(50% + 270px); }
.tag-l3 { top: calc(50% + 75px); right: calc(50% + 270px); }

.tag-r1 { top: calc(50% - 175px); left: calc(50% + 270px); }
.tag-r2 { top: calc(50% - 25px); left: calc(50% + 270px); }
.tag-r3 { top: calc(50% + 125px); left: calc(50% + 270px); }

.tag-left {
  top: 30%;
  left: calc(50% - 350px);
}

.tag-right {
  top: 45%;
  right: calc(50% - 350px);
}

.demo-section.is-visible .animated-line {
  animation: drawLine 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.demo-section.is-visible .animated-dot {
  animation: fadeDot 0.3s ease forwards;
}

.demo-section.is-visible .demo-tag {
  animation: popTag 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.demo-section.is-visible .line-l1 { animation-delay: 0.1s; }
.demo-section.is-visible .dot-l1 { animation-delay: 1.1s; }
.demo-section.is-visible .tag-l1 { animation-delay: 0.2s; }

.demo-section.is-visible .line-r1 { animation-delay: 0.2s; }
.demo-section.is-visible .dot-r1 { animation-delay: 1.2s; }
.demo-section.is-visible .tag-r1 { animation-delay: 0.3s; }

.demo-section.is-visible .line-l2 { animation-delay: 0.3s; }
.demo-section.is-visible .dot-l2 { animation-delay: 1.3s; }
.demo-section.is-visible .tag-l2 { animation-delay: 0.4s; }

.demo-section.is-visible .line-r2 { animation-delay: 0.4s; }
.demo-section.is-visible .dot-r2 { animation-delay: 1.4s; }
.demo-section.is-visible .tag-r2 { animation-delay: 0.5s; }

.demo-section.is-visible .line-l3 { animation-delay: 0.5s; }
.demo-section.is-visible .dot-l3 { animation-delay: 1.5s; }
.demo-section.is-visible .tag-l3 { animation-delay: 0.6s; }

.demo-section.is-visible .line-r3 { animation-delay: 0.6s; }
.demo-section.is-visible .dot-r3 { animation-delay: 1.6s; }
.demo-section.is-visible .tag-r3 { animation-delay: 0.7s; }

.demo-section.is-visible .tag-left { animation-delay: 0.8s; }
.demo-section.is-visible .tag-right { animation-delay: 1.2s; }
.demo-section.is-visible .line-right { animation-delay: 0.4s; }

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes popTag {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeDot {
  to { opacity: 1; }
}

@keyframes fadeUpTag {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= RESPONSIVE ================= */

/* Tablet and below: the floating tags + connector lines are built for
   a fixed 1000x600 canvas with room on both sides — there's no good
   way to keep that layout on a narrow screen, so it switches to a
   plain stacked list under the plugin instead. */
@media (max-width: 1100px) {
  .demo-content-wrapper {
    flex-direction: column;
    gap: 14px;
  }

  /* connector lines/dots only make sense in the wide floating layout */
  .demo-lines-overlay {
    display: none;
  }

  /* plugin always shows first regardless of where it sits in the DOM
     (it comes after the tags in source order) */
  .plugin-mockup {
    order: -1;
    margin: 0 auto;
  }

  /* tags: from absolutely-positioned floating pills to a simple
     stacked list. Skip the desktop pop-in choreography entirely —
     for a plain list it just reads as clutter, so they simply show. */
  .demo-tag {
    position: static;
    top: auto; left: auto; right: auto;
    width: 100%;
    max-width: 310px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
  }

  .demo-tag span { font-size: 14px; }

  /* 4 rows -> 3 rows (9 icons) — hide the last row */
  .pm-icon-item:nth-child(n+10) {
    display: none;
  }
  .plugin-mockup {
    height: 545px;
    margin-bottom: 30px;
  }

  .demo-header {
    margin-bottom: 50px;
  }
  .demo-heading {
    font-size: 36px;
  }
}

/* Mobile: shrink further to 2 rows (6 icons) */
@media (max-width: 640px) {
  .pm-icon-item:nth-child(n+7) {
    display: none;
  }
  .plugin-mockup {
    width: 100%;
    max-width: 310px;
    height: 440px;
    margin-bottom: 30px;
  }
  .demo-heading {
    font-size: 32px;
  }
  .demo-section {
    padding: 60px 40px;
  }
  .demo-tag {
    padding: 10px 16px;
  }
  .demo-tag span {
    font-size: 13px;
    white-space: normal;
  }
}