/* css/components.css — Buttons, cards, animations, portal ring */

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-neon-cyan) 0%, #00b8d4 100%);
  color: var(--color-midnight-blue);
  box-shadow: 0 4px 16px rgb(0, 229, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-soft-cyan) 0%, var(--color-neon-cyan) 100%);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
  background: rgb(0, 229, 255, 0.1);
  box-shadow: var(--shadow-glow);
}

.btn-small {
  font-size: 0.8125rem;
  padding: var(--space-2) var(--space-4);
  min-height: 44px;
}

.btn-large {
  font-size: 1.0625rem;
  padding: var(--space-4) var(--space-8);
  min-height: 52px;
}

/* ─── Glassmorphism card ─────────────────────────────────────────────────── */
.glass-card {
  background: rgb(8, 16, 28, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgb(0, 229, 255, 0.15);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.glass-card:hover {
  border-color: rgb(0, 229, 255, 0.4);
  box-shadow: var(--shadow-md);
}

/* ─── Feature detail cards ───────────────────────────────────────────────── */
.feature-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  padding: var(--space-8);
  background: rgb(8, 16, 28, 0.5);
  border: 1px solid rgb(0, 229, 255, 0.1);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
}

.feature-detail-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgb(0, 229, 255, 0.2) 0%, rgb(255, 0, 200, 0.1) 100%);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
}

.feature-detail-icon svg {
  width: 36px;
  height: 36px;
}

.feature-detail-text h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

.feature-detail-text p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ─── Portal ring animation ─────────────────────────────────────────────── */
@keyframes portal-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes portal-pulse {
  0%,
  100% {
    opacity: 0.6;
    box-shadow: 0 0 20px rgb(0, 229, 255, 0.3);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 40px rgb(0, 229, 255, 0.6);
  }
}

@keyframes neon-flicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    text-shadow:
      0 0 10px var(--color-accent),
      0 0 20px var(--color-accent),
      0 0 40px var(--color-accent);
  }

  20%,
  24%,
  55% {
    text-shadow: none;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgb(0, 229, 255, 0.2);
  }

  50% {
    box-shadow: 0 0 40px rgb(0, 229, 255, 0.4);
  }
}

/* ─── Portal ring element ───────────────────────────────────────────────── */
.portal-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.portal-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent);
  animation: portal-rotate 3s linear infinite;
}

.portal-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--color-magenta-pulse);
  border-left-color: var(--color-magenta-pulse);
  animation: portal-rotate 2s linear infinite reverse;
}

.portal-ring-center {
  position: absolute;
  inset: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgb(0, 229, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: portal-pulse 2s ease-in-out infinite;
}

.portal-ring-center svg {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
}

/* ─── Hero with portal ring ─────────────────────────────────────────────── */
.hero .portal-ring {
  margin-bottom: var(--space-8);
}

/* ─── Neon text ─────────────────────────────────────────────────────────── */
.neon-text {
  animation: neon-flicker 4s ease-in-out infinite;
}

/* ─── Neon border ──────────────────────────────────────────────────────── */
.neon-border {
  position: relative;
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--color-accent), var(--color-magenta-pulse));
  z-index: -1;
  opacity: 0.5;
  filter: blur(4px);
  transition: opacity var(--transition-base);
}

.neon-border:hover::before {
  opacity: 1;
}

/* ─── Hover glow effect ─────────────────────────────────────────────────── */
.hover-glow {
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ─── Animated gradient background accent ────────────────────────────── */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.gradient-accent {
  background: linear-gradient(
    -45deg,
    rgb(0, 229, 255, 0.1),
    rgb(255, 0, 200, 0.1),
    rgb(0, 229, 255, 0.05)
  );
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

/* ─── Link underline animation ─────────────────────────────────────────── */
@keyframes link-underline {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }

  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

.animated-link {
  position: relative;
}

.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.animated-link:hover::after {
  transform: scaleX(1);
}

/* ─── Stagger animation helper ──────────────────────────────────────────── */
.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: stagger-fade 0.5s ease forwards;
}

@keyframes stagger-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-fade-in > *:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-fade-in > *:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-fade-in > *:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-fade-in > *:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-fade-in > *:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-fade-in > *:nth-child(6) {
  animation-delay: 0.6s;
}

.stagger-fade-in > *:nth-child(7) {
  animation-delay: 0.7s;
}

.stagger-fade-in > *:nth-child(8) {
  animation-delay: 0.8s;
}

/* ─── Reduced motion overrides ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .portal-ring::before,
  .portal-ring::after,
  .portal-ring-center,
  .neon-text,
  .gradient-accent,
  .stagger-fade-in > * {
    animation: none !important;
  }

  .stagger-fade-in > * {
    opacity: 1;
    transform: none;
  }
}
