@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --color-primary: #0891b2;
  --color-primary-hover: #06b6d4;
  --color-primary-text: #ffffff;
  --color-primary-rgb: 8, 145, 178;
  --color-secondary: #059669;
  --color-secondary-hover: #10b981;
  --color-secondary-text: #ffffff;
  --color-secondary-rgb: 5, 150, 105;
  --color-accent: #22d3ee;
  --color-accent-rgb: 34, 211, 238;
  --color-bg-primary: #0f172a;
  --color-bg-primary-rgb: 15, 23, 42;
  --color-bg-secondary: #1e293b;
  --color-bg-secondary-rgb: 30, 41, 59;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: #334155;

  /* Cookie banner actions */
  --cookie-button-bg: #22d3ee;
  --cookie-button-bg-strong: #14b8a6;
  --cookie-button-border: #0ea5e9;
  --cookie-button-shadow: none;
  --cookie-button-shadow-hover: none;
  --cookie-button-text: #0b1120;
}

body {
  @apply antialiased;
  overscroll-behavior: none;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.custom-scrollbar:hover {
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 0.6rem;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
}

.custom-scrollbar:hover::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.6);
}

@keyframes insightHintFill {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  40% {
    opacity: 0.5;
    transform: scale(1);
  }
  70% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.insight-hint-highlight {
  position: relative;
  overflow: hidden;
}

.insight-hint-highlight::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(34, 211, 238, 0.2), transparent 65%);
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  animation: insightHintFill 2.4s ease-in-out infinite;
}

@keyframes insightTriggerBorderFill {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 245, 249, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(241, 245, 249, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(241, 245, 249, 0);
  }
}

.insight-trigger-pulse {
  animation: insightTriggerBorderFill 2.4s ease-in-out infinite;
}

.cookie-confetti-piece {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  animation: cookieConfettiFloat 950ms ease-out forwards;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.2));
}

.cookie-banner {
  animation-duration: 260ms;
  animation-fill-mode: both;
}

.cookie-banner--from-bottom {
  animation-name: cookieBannerPopUp;
  animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.cookie-banner--from-chip {
  animation-name: cookieBannerPopUp;
  animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}

.cookie-banner--closing {
  animation-name: cookieBannerPopDown;
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-accept-button--pulse {
  animation: cookieAcceptPulse 320ms ease-out;
}

.cookie-action {
  background: var(--cookie-button-bg);
  color: var(--cookie-button-text);
  border-color: var(--cookie-button-border);
  box-shadow: var(--cookie-button-shadow);
  transform: translateZ(0);
}

.cookie-action:active:not(:disabled) {
  transform: translateY(0);
  background: linear-gradient(
    180deg,
    rgba(var(--color-accent-rgb), 0.95) 0%,
    rgba(var(--color-accent-rgb), 0.85) 100%
  );
  color: var(--color-primary-text);
  border-color: rgba(var(--color-accent-rgb), 0.9);
  box-shadow: 0 12px 35px rgba(var(--color-accent-rgb), 0.25);
}

@media (hover: hover) {
  .cookie-action:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--cookie-button-shadow-hover);
  }
}

.cookie-accept-stage-0 {
  background: var(--cookie-button-bg);
  color: var(--cookie-button-text);
  border-color: var(--cookie-button-border);
  box-shadow: var(--cookie-button-shadow);
}

.cookie-accept-stage-1 {
  background: var(--cookie-button-bg-strong);
  color: var(--cookie-button-text);
  border-color: var(--cookie-button-border);
  box-shadow: var(--cookie-button-shadow);
}

.cookie-accept-stage-2 {
  background: var(--cookie-button-bg-strong);
  color: var(--cookie-button-text);
  border-color: var(--cookie-button-border);
  box-shadow: var(--cookie-button-shadow);
}

@keyframes cookieConfettiFloat {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.6) rotate(0deg);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-translate-x, 0px), -120px, 0) scale(1) rotate(var(--confetti-rotate, 0deg));
  }
}

@keyframes cookieAcceptPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes cookieBannerPopUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.96);
  }
  65% {
    opacity: 1;
    transform: translate3d(0, -4px, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes cookieBannerPopDown {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.98);
  }
}
