/* LinkTransparency Hero Demo Animation */

/* Hero Demo Container */
.hero-demo {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: var(--space-2xl) auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: visible;
}

/* Browser Chrome */
.browser-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-default);
}

.browser-dots .dot:nth-child(1) { background: #ef4444; }
.browser-dots .dot:nth-child(2) { background: #f59e0b; }
.browser-dots .dot:nth-child(3) { background: #22c55e; }

.url-bar {
  flex: 1;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.url-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Demo Content Area */
.demo-content {
  position: relative;
  padding: var(--space-xl);
  min-height: 300px;
}

.demo-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.demo-link {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.3s ease;
  animation: linkPulse 5s ease-in-out infinite;
}

@keyframes linkPulse {
  0%, 18% { background: transparent; }
  22%, 80% { background: rgba(59, 130, 246, 0.15); }
  84%, 100% { background: transparent; }
}

/* Animated Cursor */
.cursor {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: all 0.5s ease-out;
  left: 10%;
  top: 20%;
  animation: cursorAnimation 5s ease-in-out infinite;
}

.cursor::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid #fff;
  border-right: 8px solid transparent;
  border-bottom: 12px solid transparent;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.magnifying-glass {
  position: absolute;
  top: -8px;
  left: 16px;
  font-size: 16px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease-out;
  animation: magnifyAnimation 5s ease-in-out infinite;
}

@keyframes cursorAnimation {
  0%, 15% {
    left: 10%;
    top: 30%;
    opacity: 1;
  }
  20%, 80% {
    left: 28%;
    top: 38%;
    opacity: 1;
  }
  85%, 100% {
    left: 10%;
    top: 30%;
    opacity: 0;
  }
}

@keyframes magnifyAnimation {
  0%, 22% {
    opacity: 0;
    transform: scale(0.5);
  }
  28%, 78% {
    opacity: 1;
    transform: scale(1);
  }
  82%, 100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Inspection Panel */
.inspection-panel {
  position: absolute;
  top: 50%;
  right: -20px;
  transform: translateY(-50%) translateX(100%);
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  z-index: 100;
  animation: panelAnimation 5s ease-in-out infinite;
}

@keyframes panelAnimation {
  0%, 30% {
    opacity: 0;
    transform: translateY(-50%) translateX(100%) scale(0.95);
  }
  38%, 78% {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
  85%, 100% {
    opacity: 0;
    transform: translateY(-50%) translateX(50%) scale(0.98);
  }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-icon {
  font-size: 0.875rem;
}

.panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-section {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-section:last-of-type {
  border-bottom: none;
}

.panel-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.panel-url {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.final-url {
  color: var(--accent-blue);
  font-weight: 500;
}

/* Redirect Chain */
.redirect-chain {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.redirect-hop {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.hop-number {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hop-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.redirect-hop.final .hop-number {
  background: var(--accent-blue);
  color: #fff;
}

.redirect-hop.final .hop-url {
  color: var(--accent-blue);
}

.redirect-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 5px;
}

/* Tracker List */
.tracker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tracker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: default;
}

.tracker-item:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.tracker-item::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

.tracker-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.01em;
}

.tracker-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding-left: 4px;
  border-left: 1px solid rgba(59, 130, 246, 0.2);
}

/* Panel Actions */
.panel-actions {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.panel-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-btn.primary {
  background: var(--accent-blue);
  color: #fff;
}

.panel-btn.primary:hover {
  background: #2563eb;
}

.panel-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.panel-btn.secondary:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .inspection-panel {
    position: static;
    transform: none;
    width: 100%;
    margin-top: var(--space-lg);
    animation: panelAnimationMobile 5s ease-in-out infinite;
  }

  @keyframes panelAnimationMobile {
    0%, 30% {
      opacity: 0;
      transform: translateY(20px);
    }
    38%, 78% {
      opacity: 1;
      transform: translateY(0);
    }
    85%, 100% {
      opacity: 0;
      transform: translateY(-10px);
    }
  }
}

@media (max-width: 640px) {
  .hero-demo {
    margin: var(--space-xl) auto 0;
  }

  .demo-content {
    padding: var(--space-md);
    min-height: auto;
  }

  .cursor {
    display: none;
  }

  .inspection-panel {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .demo-link,
  .cursor,
  .magnifying-glass,
  .inspection-panel {
    animation: none !important;
    transition: none !important;
  }

  .demo-link {
    background: rgba(59, 130, 246, 0.15);
  }

  .cursor {
    opacity: 1;
    left: 28%;
    top: 38%;
  }

  .magnifying-glass {
    opacity: 1;
    transform: scale(1);
  }

  .inspection-panel {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }

  @media (max-width: 1024px) {
    .inspection-panel {
      transform: none;
    }
  }
}

/* Pause on hover */
@media (hover: hover) and (pointer: fine) {
  .hero-demo:hover .demo-link,
  .hero-demo:hover .cursor,
  .hero-demo:hover .magnifying-glass,
  .hero-demo:hover .inspection-panel {
    animation-play-state: paused;
  }
}
