/* ===== THEME SWITCHER WIDGET ===== */

.switcher-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #11110f;
  color: #f4f0e6;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.switcher-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.switcher-toggle svg {
  width: 24px;
  height: 24px;
}

.switcher-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 140px);
  background: #ffffff;
  color: #1a1a2e;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.switcher-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.switcher-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef0f2;
}

.switcher-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}

.switcher-header p {
  font-size: 12.5px;
  color: #718096;
  margin: 0;
  max-width: none;
}

.switcher-section {
  padding: 16px 20px;
  border-bottom: 1px solid #eef0f2;
}

.switcher-section:last-child {
  border-bottom: none;
}

/* Hide layout-specific switcher sections when the current layout doesn't match */
body:not([data-layout="classic"]) .switcher-section[data-layout-only="classic"] {
  display: none;
}

.switcher-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #718096;
  margin: 0 0 10px;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.layout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layout-option {
  cursor: pointer;
  padding: 10px 12px;
  border: 2px solid #eef0f2;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease;
}

.layout-option:hover {
  border-color: #cbd5e0;
}

.layout-option.active {
  border-color: #1a1a2e;
  background: #f9fafc;
}

.layout-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.layout-desc {
  font-size: 11.5px;
  color: #718096;
  line-height: 1.35;
}

.theme-option {
  cursor: pointer;
  padding: 10px;
  border: 2px solid #eef0f2;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.theme-option:hover {
  border-color: #cbd5e0;
}

.theme-option.active {
  border-color: #1a1a2e;
}

.theme-swatch {
  height: 40px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  overflow: hidden;
}

.theme-swatch span {
  flex: 1;
}

.theme-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 1px;
}

.theme-desc {
  font-size: 11.5px;
  color: #718096;
  line-height: 1.35;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feature-row label {
  font-size: 13px;
  cursor: pointer;
  flex: 1;
}

.feature-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.feature-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.feature-toggle .track {
  display: block;
  width: 100%;
  height: 100%;
  background: #cbd5e0;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.feature-toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.feature-toggle input:checked + .track {
  background: #1a1a2e;
}

.feature-toggle input:checked ~ .thumb {
  transform: translateX(16px);
}

.switcher-segmented {
  display: flex;
  gap: 4px;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 3px;
}

.switcher-segmented button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #4a5568;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.switcher-segmented button.active {
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.switcher-actions {
  display: flex;
  gap: 8px;
  padding: 14px 20px 18px;
}

.switcher-actions button {
  flex: 1;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #cbd5e0;
  background: #fff;
  color: #4a5568;
  cursor: pointer;
  font-family: inherit;
}

.switcher-actions button:hover {
  background: #f7fafc;
}

.switcher-actions .copy-link {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}

.switcher-actions .copy-link:hover {
  background: #2d3748;
}

.switcher-actions .copy-link.copied {
  background: #2f855a;
  border-color: #2f855a;
}

@media (max-width: 600px) {
  .switcher-panel {
    width: auto;
    left: 12px;
    right: 12px;
    bottom: 84px;
  }
  .switcher-toggle {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* ===== DEMO RIBBON =====
 * Fixed at very top, sits above the (also-fixed) site nav. Body gets
 * padding-top so hero content isn't covered, and the nav is pushed down
 * by the ribbon height so it doesn't overlap.
 */
:root {
  --demo-ribbon-height: 36px;
}

body:has(.demo-ribbon) {
  padding-top: var(--demo-ribbon-height);
}

body:has(.demo-ribbon) .nav {
  top: var(--demo-ribbon-height);
}

.demo-ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: #11110f;
  color: #f4f0e6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12.5px;
  text-align: center;
  padding: 8px 16px;
  letter-spacing: 0.01em;
  height: var(--demo-ribbon-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-ribbon a {
  color: #d4b360;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 8px;
  font-weight: 500;
}

.demo-ribbon a:hover {
  color: #f4d68a;
}

@media (max-width: 600px) {
  :root {
    --demo-ribbon-height: 32px;
  }
  .demo-ribbon {
    font-size: 11.5px;
    padding: 6px 12px;
  }
}
