/* Terragraph Suite - Enterprise Showcase/Tutorial System */
/* Professional, non-tacky, enterprise-grade styling */

/* Main Showcase Container */
.tg-showcase {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tg-showcase.hidden {
  display: none;
}

.tg-showcase.active {
  pointer-events: auto;
}

/* Glass Morphism Overlay */
.showcase-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.4s ease;
}

/* Spotlight Effect - Improved positioning to avoid cutoff */
.showcase-spotlight {
  position: absolute;
  border: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.2),
    0 0 40px rgba(59, 130, 246, 0.4),
    inset 0 0 20px rgba(59, 130, 246, 0.1);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  z-index: 99998; /* Below content but above everything else */
  min-width: 50px;
  min-height: 50px;
}

.showcase-spotlight.active {
  opacity: 1;
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { 
    box-shadow: 
      0 0 0 4px rgba(59, 130, 246, 0.2),
      0 0 40px rgba(59, 130, 246, 0.4),
      inset 0 0 20px rgba(59, 130, 246, 0.1);
  }
  50% { 
    box-shadow: 
      0 0 0 8px rgba(59, 130, 246, 0.3),
      0 0 60px rgba(59, 130, 246, 0.6),
      inset 0 0 30px rgba(59, 130, 246, 0.2);
  }
}

/* Main Content Panel */
.showcase-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: showcaseSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes showcaseSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Header */
.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(135deg, var(--panel-secondary), var(--panel));
  border-bottom: 1px solid var(--line);
}

.showcase-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.showcase-logo img {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.showcase-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

.showcase-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-close:hover {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.4);
  color: #ff3b30;
  transform: scale(1.1);
}

/* Body */
.showcase-body {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(90vh - 240px);
}

.showcase-step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 20px;
}

.step-current {
  font-weight: 700;
  color: var(--accent);
}

.step-separator {
  opacity: 0.5;
}

.step-total {
  opacity: 0.7;
}

.showcase-step-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.showcase-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Feature List Grid */
.showcase-feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.feature-item {
  padding: 16px;
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Demo Area */
.showcase-demo-area {
  min-height: 200px;
  padding: 24px;
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.demo-animation {
  text-align: center;
  width: 100%;
}

.demo-svg {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.draw-rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 10, 5;
  animation: drawPath 2s ease-in-out infinite;
}

@keyframes drawPath {
  to {
    stroke-dashoffset: -15;
  }
}

.demo-text {
  fill: var(--text);
  font-size: 24px;
  font-weight: 600;
}

.demo-caption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.showcase-footer {
  padding: 24px 32px;
  background: var(--panel-secondary);
  border-top: 1px solid var(--line);
}

.showcase-progress {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Controls */
.showcase-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.btn-showcase {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--btn);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-showcase:hover:not(:disabled) {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-showcase:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-showcase.btn-play {
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-color: transparent;
  color: white;
  min-width: 140px;
  justify-content: center;
}

.btn-showcase.btn-play:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-showcase.btn-play.playing {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.play-icon, .pause-icon {
  font-size: 16px;
}

.showcase-skip {
  text-align: center;
}

.btn-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-skip:hover {
  opacity: 1;
}

/* Floating Tooltip */
.showcase-tooltip {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(59, 130, 246, 0.2);
  z-index: 100001;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 300px;
}

.showcase-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--panel);
  border-left: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

.tooltip-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* Trigger Button */
.showcase-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border: 1px solid transparent;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.showcase-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.trigger-icon {
  font-size: 16px;
}

/* Highlight Effect */
.showcase-highlight {
  animation: highlightPulse 1s ease-in-out 3;
  position: relative;
  z-index: 99999;
  /* Prevent blur effect from affecting highlighted elements */
  filter: blur(0px) !important;
  -webkit-filter: blur(0px) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(59, 130, 246, 0.4);
  }
}

/* Demo Specific Styles */
.clip-demo, .mask-demo, .selection-demo, .style-demo, .rest-demo, .export-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

/* Enhanced Style Demo */
.style-controls {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.control-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.color-picker-demo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.color-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.slider-demo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-track {
  width: 80px;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  position: relative;
}

.slider-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 32px;
}

.styled-preview {
  display: flex;
  gap: 16px;
}

.feature-preview {
  padding: 12px 20px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.feature-preview.choropleth {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border-color: var(--accent);
}

/* Enhanced REST Demo */
.server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.server-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.server-item.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border-color: var(--accent);
}

.server-icon {
  font-size: 20px;
}

.server-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.server-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.server-status {
  font-size: 12px;
  color: var(--text-muted);
}

.data-flow {
  text-align: center;
}

.flow-arrow {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 8px;
}

.layer-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

/* Enhanced Export Demo */
.export-workflow {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.step-item.active {
  opacity: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s ease;
}

.step-item.active .step-number {
  background: var(--accent);
  color: white;
}

.step-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.export-formats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.format-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s ease;
  opacity: 0.6;
  cursor: pointer;
}

.format-card.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border-color: var(--accent);
  transform: translateY(-4px);
}

.format-card .format-icon {
  font-size: 24px;
}

.format-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.format-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.export-preview {
  padding: 16px;
  background: var(--panel-secondary);
  border-radius: 8px;
  border: 1px dashed var(--line);
}

.preview-file {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  font-size: 18px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--btn);
  padding: 2px 8px;
  border-radius: 4px;
}

.layer-before, .layer-after {
  padding: 16px 24px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-weight: 600;
}

.layer-after {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border-color: var(--accent);
}

.clip-arrow {
  font-size: 24px;
  color: var(--accent);
}

.state-shape {
  padding: 24px 32px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  color: white;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 700;
}

.county-shapes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.county-shapes span {
  padding: 8px 16px;
  background: var(--btn);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.feature.selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border-color: var(--accent);
  transform: scale(1.1);
}

.color-palette {
  display: flex;
  gap: 8px;
}

.color-palette span {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.styled-features {
  padding: 16px 32px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
}

.server-icon, .map-icon {
  font-size: 48px;
}

.data-flow {
  font-size: 32px;
  color: var(--accent);
  animation: flowPulse 1.5s ease-in-out infinite;
}

@keyframes flowPulse {
  0%, 100% { opacity: 0.5; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(10px); }
}

.format-icon {
  padding: 12px 20px;
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.format-icon:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* Final Screen */
.final-screen {
  text-align: center;
  padding: 32px;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.final-screen h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.final-screen p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.final-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-final {
  padding: 12px 24px;
  background: var(--btn);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-final:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-start {
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-color: transparent;
  color: white;
}

/* Animation Classes */
@keyframes showcaseFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes showcaseSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes showcasePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .showcase-content {
    width: 95%;
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .showcase-header {
    padding: 16px 20px;
  }
  
  .showcase-body {
    padding: 20px;
  }
  
  .showcase-step-title {
    font-size: 24px;
  }
  
  .showcase-description {
    font-size: 16px;
  }
  
  .showcase-controls {
    flex-wrap: wrap;
  }
  
  .btn-showcase {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Enhanced Basemap Demo Styles */
.basemap-demo {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.basemap-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.basemap-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: all 0.3s ease;
  opacity: 0.6;
  cursor: pointer;
}

.basemap-card.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border-color: var(--accent);
  transform: translateY(-4px);
}

.basemap-preview {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.basemap-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.basemap-type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.basemap-features {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.feature-badge {
  padding: 6px 12px;
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
  opacity: 0.5;
}

.feature-badge.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border-color: var(--accent);
  color: var(--accent);
}

.basemap-preview-large {
  width: 100%;
  max-width: 300px;
}

.preview-map {
  background: var(--panel-secondary);
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 20px;
}

.map-layers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-item {
  padding: 8px 12px;
  background: var(--btn);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

/* Enhanced Search Demo Styles */
.search-demo {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
}

.search-input-demo {
  width: 100%;
  max-width: 400px;
}

.search-box-demo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 16px;
}

.search-icon {
  color: var(--accent);
  font-size: 18px;
}

.search-text {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.search-cursor {
  color: var(--accent);
  animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.search-results {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
}

.result-icon {
  font-size: 16px;
}

.result-info {
  flex: 1;
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.result-coords {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.geocoding-providers {
  display: flex;
  gap: 16px;
}

.provider {
  padding: 8px 16px;
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
  opacity: 0.5;
}

.provider.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border-color: var(--accent);
  color: var(--accent);
}

/* Live Demo Styles */
.live-demo {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  width: 100%;
}

.live-demo-compact {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px;
}

/* Live Demo Mode - Top Right Positioning */
.tg-showcase.live-demo-mode {
  pointer-events: auto;
}

.tg-showcase.live-demo-mode .showcase-content {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  transform: none !important;
  width: 380px !important;
  max-width: 380px !important;
  max-height: 80vh !important;
  z-index: 100001 !important;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* Moved to above section for better organization */

/* Highlight animations for map elements */
.showcase-map-highlight {
  position: relative;
  z-index: 99999;
  animation: mapElementPulse 2s ease-in-out infinite;
  overflow: visible !important;
}

@keyframes mapElementPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    border-color: initial;
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(59, 130, 246, 0.6);
    border-color: var(--accent) !important;
  }
}

/* Ensure highlights don't get cut off */
.showcase-map-highlight::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 3px solid var(--accent);
  border-radius: 8px;
  pointer-events: none;
  animation: highlightPulse 2s ease-in-out infinite;
  z-index: 100000;
}

@keyframes highlightPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Remove blue background and blur during live showcase */
.tg-showcase.live-demo-mode .showcase-overlay {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

/* Ensure highlighted elements and their children are never blurred */
.showcase-highlight,
.showcase-highlight *,
.showcase-map-highlight,
.showcase-map-highlight *,
.showcase-layer-highlight,
.showcase-layer-highlight * {
  filter: blur(0px) !important;
  -webkit-filter: blur(0px) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Prevent any blur from propagating to children */
.tg-showcase .showcase-highlight {
  isolation: isolate !important;
}

.tg-showcase .showcase-map-highlight {
  isolation: isolate !important;
}

/* Better spotlight positioning - avoid overflow issues */
.tg-showcase .showcase-spotlight {
  overflow: visible !important;
}

.tg-showcase .showcase-spotlight.active {
  /* Ensure spotlight is visible even when close to edges */
  min-width: 60px !important;
  min-height: 60px !important;
}

/* Layer highlight in sidebar */
.showcase-layer-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2)) !important;
  border: 2px solid var(--accent) !important;
  animation: layerPulse 1.5s ease-in-out 3;
}

@keyframes layerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Measurement overlay */
.showcase-measurement-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 100000;
  min-width: 300px;
  text-align: center;
  animation: measurementAppear 0.5s ease-out;
}

@keyframes measurementAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.measurement-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.measurement-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.measurement-stat {
  padding: 12px;
  background: var(--btn);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.measurement-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.measurement-close {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.measurement-save {
  padding: 8px 16px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.measurement-save:hover {
  background: #059669;
  transform: translateY(-1px);
}

.measurement-close:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Live instructions styling */
.live-instructions {
  text-align: center;
  padding: 16px;
  background: var(--panel-secondary);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.instruction-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.instruction-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Progress indicators for live demos */
.live-progress-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-top: 16px;
}

.progress-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Action callouts */
.showcase-action-callout {
  position: fixed;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100002;
  animation: calloutBounce 0.5s ease-out;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

@keyframes calloutBounce {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.callout-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--accent);
}

/* Layer counter animation */
.showcase-layer-counter {
  position: fixed;
  top: 100px;
  right: 30px;
  background: var(--panel);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  z-index: 100000;
  min-width: 200px;
  animation: counterSlideIn 0.5s ease-out;
}

@keyframes counterSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.counter-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 12px;
  text-align: center;
}

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

.counter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--btn);
  border-radius: 6px;
  font-size: 12px;
}

.counter-label {
  color: var(--text);
  font-weight: 500;
}

.counter-value {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Clipping visualization */
.showcase-clipping-visualization {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 100000;
  animation: clippingSlideUp 0.5s ease-out;
}

@keyframes clippingSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.clipping-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

.clipping-layers {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.clipping-layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 100px;
  transition: all 0.3s ease;
}

.clipping-layer.processing {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border-color: #8b5cf6;
  animation: processingPulse 1s ease-in-out infinite;
}

.clipping-layer.completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(34, 197, 94, 0.2));
  border-color: var(--success);
}

@keyframes processingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.clipping-layer-icon {
  font-size: 24px;
}

.clipping-layer-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.clipping-layer-status {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.clipping-results {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.clipping-result-text {
  font-size: 14px;
  color: var(--success);
  font-weight: 600;
}

.demo-status {
  text-align: center;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.status-indicator.loading {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid #fbbf24;
  color: #f59e0b;
}

.status-indicator.active {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.status-indicator.processing {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid #8b5cf6;
  color: #8b5cf6;
}

.status-indicator.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  color: var(--success);
}

.demo-progress {
  width: 100%;
  max-width: 400px;
}

.live-progress {
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.drawing-simulation {
  width: 100%;
  max-width: 300px;
}

.live-drawing-svg {
  width: 100%;
  height: auto;
  background: var(--panel-secondary);
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 20px;
}

.live-polygon {
  transition: all 0.5s ease;
}

.clipping-visualization {
  width: 100%;
  max-width: 400px;
}

.clip-layers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.layer-item.processing {
  opacity: 1;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
  border-color: #8b5cf6;
}

.layer-item.completed {
  opacity: 1;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
  border-color: var(--success);
}

.layer-item.waiting {
  opacity: 0.4;
}

.layer-icon {
  font-size: 18px;
}

.layer-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.layer-status {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.styling-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

.style-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--btn);
  border: 2px solid var(--line);
  border-radius: 8px;
  width: 100%;
  transition: all 0.3s ease;
}

.style-option.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border-color: var(--accent);
}

.style-icon {
  font-size: 20px;
}

.style-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.color-ramp {
  display: flex;
  width: 100%;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-stop {
  flex: 1;
  transition: opacity 0.3s ease;
}

/* Restart button style */
.btn-restart {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-color: transparent;
  color: white;
}

.btn-restart:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Mobile Responsive for New Elements */
@media (max-width: 768px) {
  .basemap-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .basemap-features {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .search-results {
    max-width: 100%;
  }
  
  .geocoding-providers {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .tg-showcase.live-demo-mode .showcase-content {
    width: 95% !important;
    max-width: 95% !important;
    right: 2.5% !important;
    top: 10px !important;
  }
  
  .showcase-measurement-overlay {
    width: 90%;
    min-width: auto;
  }
  
  .measurement-stats {
    grid-template-columns: 1fr;
  }
  
  .showcase-layer-counter {
    right: 10px;
    min-width: 150px;
  }
  
  .showcase-clipping-visualization {
    left: 5%;
    right: 5%;
    transform: none;
    width: 90%;
  }
  
  .clipping-layers {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Theme Compatibility */
html[data-theme="light"] .showcase-overlay {
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .showcase-content {
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .showcase-tooltip {
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(59, 130, 246, 0.2);
}

/* Layer Demo Animation Styles */
.layer-demo-container {
  padding: 20px;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 16px 0;
}

.demo-file-upload {
  margin-bottom: 20px;
}

.upload-zone {
  border: 2px dashed var(--accent);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: rgba(59, 130, 246, 0.05);
  transition: all 0.3s ease;
}

.upload-zone:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.8);
}

.upload-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.upload-text {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-formats {
  font-size: 12px;
  color: var(--text-muted);
}

.layer-processing {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.processing-step.active {
  opacity: 1;
  transform: translateX(4px);
}

.step-icon {
  font-size: 16px;
}

.step-text {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.step-status {
  font-size: 14px;
  min-width: 20px;
  text-align: center;
}

.layer-result {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(10px);
}

.result-layer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.result-layer:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.layer-icon {
  font-size: 18px;
}

.layer-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.layer-features {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 8px;
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.layer-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.layer-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

@keyframes layerSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}