/* Landing Page Custom Animations & Effects */

/* Font Family Setup */
body[data-controller="landing"] {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Keyframe Animations */

@keyframes gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 200% 50%;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    filter: blur(120px);
  }
  50% {
    opacity: 0.6;
    filter: blur(140px);
  }
}

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

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.8);
  }
}

@keyframes text-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow:
      0 0 4px #fff,
      0 0 11px #fff,
      0 0 19px #fff,
      0 0 40px #06b6d4,
      0 0 80px #06b6d4,
      0 0 90px #06b6d4,
      0 0 100px #06b6d4,
      0 0 150px #06b6d4;
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

@keyframes border-flow {
  0%, 100% {
    border-color: rgba(6, 182, 212, 0.3);
  }
  50% {
    border-color: rgba(59, 130, 246, 0.6);
  }
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Apply Animations */

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient 3s ease infinite;
}

.animate-gradient-shift {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

.animate-fade-in {
  animation: fade-in 0.8s ease-out;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-slow {
  animation: pulse-glow 4s ease-in-out infinite;
}

.delay-1000 {
  animation-delay: 1s;
}

.delay-2000 {
  animation-delay: 2s;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Smooth Scroll with Offset for Fixed Nav */
html {
  scroll-padding-top: 80px;
}

/* Custom Text Selection */
::selection {
  background-color: rgba(6, 182, 212, 0.3);
  color: #fff;
}

::-moz-selection {
  background-color: rgba(6, 182, 212, 0.3);
  color: #fff;
}

/* Neon Glow Effects */
.neon-text {
  text-shadow:
    0 0 7px #fff,
    0 0 10px #fff,
    0 0 21px #fff,
    0 0 42px #06b6d4,
    0 0 82px #06b6d4,
    0 0 92px #06b6d4,
    0 0 102px #06b6d4,
    0 0 151px #06b6d4;
}

.neon-border {
  box-shadow:
    0 0 5px rgba(6, 182, 212, 0.5),
    0 0 10px rgba(6, 182, 212, 0.4),
    0 0 20px rgba(6, 182, 212, 0.3),
    0 0 40px rgba(6, 182, 212, 0.2);
}

.neon-glow-cyan {
  box-shadow:
    0 0 20px rgba(6, 182, 212, 0.5),
    0 0 40px rgba(6, 182, 212, 0.3),
    0 0 60px rgba(6, 182, 212, 0.2);
}

.neon-glow-blue {
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.5),
    0 0 40px rgba(59, 130, 246, 0.3),
    0 0 60px rgba(59, 130, 246, 0.2);
}

.neon-glow-purple {
  box-shadow:
    0 0 20px rgba(168, 85, 247, 0.5),
    0 0 40px rgba(168, 85, 247, 0.3),
    0 0 60px rgba(168, 85, 247, 0.2);
}

/* Glassmorphism Effects */
.glass-card {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(6, 182, 212, 0.2);
  box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.1);
}

.glass-card:hover {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.2);
}

/* Grid Background Effect */
.grid-background {
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 50px 50px;
  }
}

/* Hover Effects */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(6, 182, 212, 0.3);
}

/* Animated Gradient Borders */
.gradient-border {
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, #06b6d4, #3b82f6, #a855f7, #06b6d4);
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Particle Effect */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #06b6d4;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particle-float 3s ease-out forwards;
}

@keyframes particle-float {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(0);
  }
}

/* Horizontally scrollable table wrapper with right-edge gradient fade */
.table-scroll-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2rem;
  background: linear-gradient(to left, rgb(15 23 42), transparent);
  pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .neon-text {
    text-shadow:
      0 0 5px #fff,
      0 0 10px #fff,
      0 0 15px #fff,
      0 0 20px #06b6d4,
      0 0 35px #06b6d4;
  }

  .glass-card {
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
  }
}

/* Loading State */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(6, 182, 212, 0.3) 50%,
    rgba(6, 182, 212, 0.1) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #a855f7);
  transform-origin: left;
  z-index: 9999;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #06b6d4, #3b82f6);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0891b2, #2563eb);
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Prevent Layout Shift */
.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio-square {
  aspect-ratio: 1 / 1;
}

/* Focus States for Accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}

/* Hamburger Icon Bar Morph: 3-bar to X when nav has is-open class */
/* Top bar rotates +45deg and moves down to cross center */
nav.is-open [data-hamburger-menu-target="button"] span.flex span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

/* Middle bar fades out */
nav.is-open [data-hamburger-menu-target="button"] span.flex span:nth-child(2) {
  opacity: 0;
}

/* Bottom bar rotates -45deg and moves up to cross center */
nav.is-open [data-hamburger-menu-target="button"] span.flex span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Enhancements (already in dark mode, but for contrast) */
@media (prefers-color-scheme: dark) {
  body[data-controller="landing"] {
    background-color: #020617;
  }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent-banner.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile adjustments for cookie banner */
@media (max-width: 640px) {
  .cookie-consent-banner {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  body[data-controller="landing"] {
    background: white;
    color: black;
  }

  .neon-text,
  .neon-border,
  .neon-glow-cyan,
  .neon-glow-blue,
  .neon-glow-purple {
    text-shadow: none;
    box-shadow: none;
  }

  .cookie-consent-banner {
    display: none !important;
  }
}

/* ============================================
 * Phase 28: Startups drag-and-drop visibility gate
 * Rule 1 — Handle visibility is role-gated via container state
 * (broadcast-safe: handle is always emitted in markup; CSS hides
 * it for non-managers whose #startups_list lacks data-controller="sortable")
 * ============================================ */
#startups_list:not([data-controller~="sortable"]) .startup-drag-handle {
  display: none;
}

/* ============================================
 * Phase 28: SortableJS drop placeholder for startup cards
 * Rule 2 — Cyan dashed placeholder where the dragged card will land
 * Scoped to .startup-card so it does not affect checklist UI ghosts
 * ============================================ */
.sortable-ghost.startup-card {
  opacity: 0.3;
  border: 2px dashed rgba(6, 182, 212, 0.4) !important;
  border-radius: 1rem;
  background: rgba(6, 182, 212, 0.05) !important;
  box-shadow: none !important;
}

/* ============================================
 * Phase 67: SortableJS drag feedback for per-startup checklist items
 * Scoped with :not(.startup-card) to avoid overriding Phase 28 startup card ghost styles
 * ============================================ */
.sortable-ghost:not(.startup-card) {
  opacity: 0.4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  border-radius: 0.75rem;
}

.sortable-chosen:not(.startup-card) {
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.sortable-over:not(.startup-card) {
  outline: 1px solid rgba(6, 182, 212, 0.5);
  background-color: rgba(6, 182, 212, 0.04);
  border-radius: 0.75rem;
}

/* ============================================
 * Phase 76: SortableJS drag feedback for note cards
 * Scoped to .note-card for dashed-border ghost (distinct from checklist ghost)
 * Overrides .sortable-ghost:not(.startup-card) with !important to ensure
 * note cards get the dashed-cyan placeholder instead of the solid glow.
 * ============================================ */
.sortable-ghost.note-card {
  opacity: 0.3;
  border: 2px dashed rgba(6, 182, 212, 0.4) !important;
  border-radius: 1rem;
  background: rgba(6, 182, 212, 0.05) !important;
  box-shadow: none !important;
}
