/* ========================================
   FischTools Custom CSS
   Animations, terminal effects, particles
   ======================================== */

/* ---------- Font Faces ---------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --ocean-teal: #00B4D8;
  --deep-sea: #023E8A;
  --sandy-gold: #E9C46A;
  --coral-pop: #E76F51;
  --tropical-green: #2A9D8F;
  --bg-light: #F0F8FF;
  --bg-dark: #0D1B2A;
  --text-primary: #1B263B;
  --text-light: #FFFFFF;
  --text-muted: #64748B;
  --terminal-green: #2A9D8F;
  --terminal-warn: #E9C46A;
  --terminal-error: #E76F51;
}

/* ---------- Keyframe Animations ---------- */

/* Shake for input validation errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Blinking terminal cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--terminal-green);
  margin-left: 2px;
}

/* Pulse glow for processing state */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.3), 0 0 20px rgba(0, 180, 216, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.6), 0 0 40px rgba(0, 180, 216, 0.3);
  }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Progress bar shimmer */
@keyframes progressShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--ocean-teal), var(--tropical-green), var(--ocean-teal));
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  transition: width 0.3s ease-out;
}

/* Pulse for reward card PENDING CLAIM badge */
@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.pulse-scale {
  animation: pulse-scale 2s ease-in-out infinite;
}

/* Fade in up for section reveals */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* Fade in only */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Float/bob for icons */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

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

/* Slide in for cards */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.4s ease-out forwards;
  opacity: 0;
}

/* Scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

/* Confetti celebration */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 2.5s ease-in forwards;
  z-index: 9999;
  pointer-events: none;
}

/* Terminal line reveal */
@keyframes terminalLineIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.terminal-line {
  animation: terminalLineIn 0.2s ease-out forwards;
  opacity: 0;
}

/* Spin for loading spinners */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 0.8s linear infinite;
}

/* Notification toast slide in from right */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Tick marks on progress bar */
@keyframes tickPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---------- Utility Classes ---------- */

.terminal-window {
  background: var(--bg-dark);
  border: 1px solid rgba(0, 180, 216, 0.2);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-header {
  background: rgba(0, 180, 216, 0.1);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 180, 216, 0.15);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #E76F51; }
.terminal-dot.yellow { background: #E9C46A; }
.terminal-dot.green { background: #2A9D8F; }

.terminal-body {
  padding: 16px;
  min-height: 240px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--terminal-green);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 180, 216, 0.3) transparent;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 216, 0.3);
  border-radius: 3px;
}

.terminal-log {
  color: var(--terminal-green);
}

.terminal-log.warn {
  color: var(--terminal-warn);
}

.terminal-log.error {
  color: var(--terminal-error);
}

.terminal-log.info {
  color: var(--ocean-teal);
}

/* ---------- Particle Background ---------- */

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Glass morphism navbar ---------- */

.glass-nav {
  background: rgba(2, 62, 138, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 180, 216, 0.15);
}

/* ---------- CPA Locker overlay ---------- */

.locker-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---------- Reward card styling ---------- */

.reward-card {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0a1628 100%);
  border: 2px solid var(--sandy-gold);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(233, 196, 106, 0.15), 0 0 60px rgba(0, 180, 216, 0.1);
}

/* ---------- Selection card hover ---------- */

.selection-card {
  border: 2px solid rgba(0, 180, 216, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
}

.selection-card:hover {
  border-color: var(--ocean-teal);
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.2);
  transform: translateY(-2px);
}

.selection-card.active {
  border-color: var(--ocean-teal);
  box-shadow: 0 0 25px rgba(0, 180, 216, 0.35);
  background: rgba(0, 180, 216, 0.05);
}

/* ---------- Trust badge row ---------- */

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0, 180, 216, 0.05);
  border: 1px solid rgba(0, 180, 216, 0.1);
}

/* ---------- Activity ticker ---------- */

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-track {
  animation: tickerScroll 40s linear infinite;
  display: flex;
  gap: 32px;
}

.ticker-track:hover {
  animation-play-state: paused;
}

/* ---------- FAQ accordion ---------- */

.faq-item {
  border-bottom: 1px solid rgba(0, 180, 216, 0.1);
}

.faq-question {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--ocean-teal);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-answer.open {
  max-height: 500px;
  padding-bottom: 16px;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-chevron.open {
  transform: rotate(180deg);
}

/* ---------- Countdown animation ---------- */

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.countdown-active {
  animation: countdownPulse 1s ease-in-out infinite;
}

/* ---------- CTA Button Glow ---------- */

.btn-primary-glow {
  background: var(--ocean-teal);
  color: var(--text-light);
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
  transition: all 0.3s ease;
}

.btn-primary-glow:hover {
  background: #00C8EC;
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.6);
  transform: scale(1.03);
}

.btn-primary-glow:active {
  transform: scale(0.97);
}

.btn-locker-glow {
  background: var(--coral-pop);
  color: var(--text-light);
  box-shadow: 0 0 25px rgba(231, 111, 81, 0.4);
  animation: pulse-glow 1.5s ease-in-out infinite;
  transition: all 0.3s ease;
}

.btn-locker-glow:hover {
  background: #EF7F63;
  box-shadow: 0 0 35px rgba(231, 111, 81, 0.6);
  transform: scale(1.03);
}

/* ---------- Checkmark animation ---------- */

@keyframes checkmark-draw {
  to { stroke-dashoffset: 0; }
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark-draw 0.6s ease-out forwards;
}

.checkmark-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark-draw 0.3s 0.6s ease-out forwards;
}

/* ---------- Mobile Responsive ---------- */

@media (max-width: 768px) {
  .terminal-body {
    font-size: 12px;
    min-height: 200px;
    max-height: 320px;
    padding: 12px;
  }

  .ticker-track {
    animation-duration: 25s;
    gap: 20px;
  }

  .trust-badge {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .terminal-body {
    font-size: 11px;
    min-height: 180px;
    max-height: 260px;
    padding: 10px;
  }

  .terminal-header {
    padding: 6px 10px;
  }
}

/* ---------- Accessibility ---------- */

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

/* ---------- Focus styles ---------- */

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--ocean-teal);
  outline-offset: 2px;
}

/* ---------- Tooltip ---------- */

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid rgba(0, 180, 216, 0.2);
}

.tooltip:hover::after {
  opacity: 1;
}
