/**
 * Hero CRM dashboard mockup
 */

.hero-visual {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.hero-visual {
  overflow: visible;
}

.hero-dashboard-scene {
  --dash-bg: #0b1120;
  --dash-panel: #111827;
  --dash-border: rgba(148, 163, 184, 0.12);
  --dash-text: #f8fafc;
  --dash-muted: #94a3b8;
  --dash-green: #11b956;
  --dash-green-glow: rgba(17, 185, 86, 0.45);
  --dash-purple: #8b5cf6;
  --dash-radius: 14px;
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px) 0;
  font-family: var(--font-primary, 'Inter', sans-serif);
}

/* Framer-style entrance */
.hero-dash-motion {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(22px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--hero-dash-delay, 0s);
  will-change: opacity, filter, transform;
}

.hero-dashboard-scene.is-loaded .hero-dash-motion {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

/* Main app window */
.hero-dash-app {
  position: relative;
  z-index: 2;
  background: linear-gradient(165deg, #0f172a 0%, var(--dash-bg) 55%, #070b14 100%);
  border: 1px solid var(--dash-border);
  border-radius: calc(var(--dash-radius) + 4px);
  box-shadow:
    0 32px 64px rgba(3, 18, 66, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 80px rgba(17, 185, 86, 0.06);
  overflow: hidden;
}

.hero-dash-app__chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--dash-border);
}

.hero-dash-window-dots {
  display: flex;
  gap: 5px;
}

.hero-dash-window-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hero-dash-window-dots i:nth-child(1) { background: #ff5f57; }
.hero-dash-window-dots i:nth-child(2) { background: #febc2e; }
.hero-dash-window-dots i:nth-child(3) { background: #28c840; }

.hero-dash-app__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--dash-muted);
  letter-spacing: 0.01em;
}

.hero-dash-app__globe {
  color: var(--dash-muted);
  opacity: 0.85;
}

.hero-dash-app__body {
  display: grid;
  grid-template-columns: 45% 1fr;
  min-height: 340px;
}

/* Sidebar */
.hero-dash-sidebar {
  padding: 10px 8px 12px;
  border-right: 1px solid var(--dash-border);
  background: rgba(8, 12, 24, 0.6);
}

.hero-dash-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  font-size: 0.625rem;
  color: var(--dash-muted);
}

.hero-dash-search svg {
  flex-shrink: 0;
  color: var(--dash-muted);
  opacity: 0.7;
}

.hero-dash-threads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-dash-thread {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.hero-dash-thread.is-active {
  background: rgba(17, 185, 86, 0.08);
  border-color: rgba(17, 185, 86, 0.35);
  box-shadow:
    0 0 0 1px rgba(17, 185, 86, 0.15),
    0 0 24px var(--dash-green-glow);
  animation: heroDashGlow 3s ease-in-out infinite;
}

@keyframes heroDashGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(17, 185, 86, 0.15), 0 0 20px rgba(17, 185, 86, 0.2); }
  50% { box-shadow: 0 0 0 1px rgba(17, 185, 86, 0.25), 0 0 32px rgba(17, 185, 86, 0.35); }
}

.hero-dash-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hero-dash-avatar--green { background: linear-gradient(145deg, #22c55e, #15803d); }
.hero-dash-avatar--purple { background: linear-gradient(145deg, #a78bfa, #7c3aed); }
.hero-dash-avatar--orange { background: linear-gradient(145deg, #fb923c, #ea580c); }
.hero-dash-avatar--blue { background: linear-gradient(145deg, #60a5fa, #2563eb); }

.hero-dash-avatar__dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dash-green);
  border: 2px solid var(--dash-bg);
}

.hero-dash-thread__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.hero-dash-thread__top strong {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--dash-text);
  flex: 1;
  min-width: 0;
}

.hero-dash-thread__top time {
  font-size: 0.5625rem;
  color: var(--dash-muted);
  margin-left: auto;
}

.hero-dash-thread__preview {
  margin: 0;
  font-size: 0.5625rem;
  color: var(--dash-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-dash-pill {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
}

.hero-dash-pill--ai {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.hero-dash-pill--ok {
  background: rgba(17, 185, 86, 0.2);
  color: var(--dash-green);
}

.hero-dash-thread__badge {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #fff;
  background: var(--dash-green);
  border-radius: 999px;
}

/* Chat panel */
.hero-dash-chat {
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  background: rgba(11, 17, 32, 0.5);
  min-width: 0;
}

.hero-dash-chat__head strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dash-text);
}

.hero-dash-chat__head p {
  margin: 2px 0 0;
  font-size: 0.5625rem;
  color: var(--dash-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-dash-online {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dash-green);
  box-shadow: 0 0 8px var(--dash-green);
}

.hero-dash-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  min-height: 140px;
}

.hero-dash-bubble {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.695rem;
  line-height: 1.65;
  color: var(--dash-text);
}

.hero-dash-bubble--in {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--dash-border);
}

.hero-dash-bubble--ai {
  align-self: flex-end;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: linear-gradient(135deg, rgba(17, 185, 86, 0.22) 0%, rgba(17, 185, 86, 0.08) 100%);
  border: 1px solid rgba(17, 185, 86, 0.35);
  box-shadow: 0 0 28px rgba(17, 185, 86, 0.2);
  animation: heroDashAiGlow 2.8s ease-in-out infinite;
}

@keyframes heroDashAiGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(17, 185, 86, 0.15); }
  50% { box-shadow: 0 0 36px rgba(17, 185, 86, 0.32); }
}

.hero-dash-bubble__ai {
  flex-shrink: 0;
  font-size: 0.5rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--dash-green);
  color: #031242;
}

.hero-dash-bubble--typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--dash-border);
  font-size: 0.5625rem;
  color: var(--dash-muted);
}

.hero-dash-typing {
  display: inline-flex;
  gap: 3px;
}

.hero-dash-typing i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dash-muted);
  animation: heroDashTyping 1.2s ease-in-out infinite;
}

.hero-dash-typing i:nth-child(2) { animation-delay: 0.15s; }
.hero-dash-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes heroDashTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.hero-dash-suggest {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-top: auto;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 999px;
  font-size: 0.5625rem;
  color: #c4b5fd;
}

.hero-dash-suggest svg {
  flex-shrink: 0;
  color: var(--dash-purple);
}

.hero-dash-suggest span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-dash-pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--dash-border);
}

.hero-dash-stage {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--dash-muted);
}

.hero-dash-stage.is-current {
  color: var(--dash-text);
  border-color: rgba(248, 250, 252, 0.5);
  background: rgba(248, 250, 252, 0.06);
}

.hero-dash-stage-arrow {
  font-size: 0.5625rem;
  color: var(--dash-muted);
  opacity: 0.5;
}

/* Floating widgets */
.hero-dash-float {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  max-width: min(200px, 42vw);
}

.hero-dash-float--lead {
  top: -4%;
  right: -2%;
}

.hero-dash-float--rate {
  bottom: -1%;
  left: -6%;
}

.hero-dash-float__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-dash-float__icon--bolt {
  background: rgba(17, 185, 86, 0.15);
  color: var(--dash-green);
}

.hero-dash-float__icon--chart {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
}

.hero-dash-float__label {
  margin: 0 0 2px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--dash-text);
}

.hero-dash-float__value {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--dash-text);
}

.hero-dash-float__meta {
  margin: 4px 0 0;
  font-size: 0.5625rem;
  color: var(--dash-muted);
  opacity: 0.7;
}

.hero-dash-float__stat {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--dash-green);
}

/* Responsive */
@media (max-width: 1200px) {
  .hero-dashboard-scene {
    max-width: 480px;
  }

  .hero-dash-float--lead {
    right: 0;
  }

  .hero-dash-float--rate {
    left: 0;
  }
}

@media (max-width: 1024px) {
  .hero-visual {
    display: none !important;
  }

  .hero-dashboard-scene {
    max-width: min(520px, 100%);
    transform: scale(0.92);
    transform-origin: center top;
  }

  .hero-dash-float--lead {
    top: 0;
    right: 2%;
  }

  .hero-dash-float--rate {
    bottom: 2%;
    left: 2%;
  }
}

@media (max-width: 640px) {
  .hero-dashboard-scene {
    transform: scale(0.88);
    padding-bottom: 8px;
  }

  .hero-dash-app__body {
    grid-template-columns: 38% 1fr;
    min-height: 280px;
  }

  .hero-dash-float {
    padding: 10px 12px;
    max-width: 46vw;
  }

  .hero-dash-float__value,
  .hero-dash-float__stat {
    font-size: 0.625rem;
  }

  .hero-dash-float--lead {
    top: 2%;
    right: 0;
  }

  .hero-dash-float--rate {
    bottom: 0;
    left: 0;
  }

  .hero-dash-thread__preview,
  .hero-dash-suggest span {
    font-size: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero-dashboard-scene {
    transform: scale(0.82);
  }

  .hero-dash-float--rate {
    display: none;
  }

  .hero-dash-messages {
    min-height: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dash-motion {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  .hero-dash-thread.is-active,
  .hero-dash-bubble--ai {
    animation: none;
  }

  .hero-dash-typing i {
    animation: none;
  }
}
