/* ===================================
   Activity Hub - Hero Height Variables
   =================================== */

:root {
  --activity-hub-hero-only: 142px;
}

@media (max-width: 640px) {
  :root {
    --activity-hub-hero-only: 96px;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  :root {
    --activity-hub-hero-only: 116px;
  }
}

/* Activity Hub Hero Height */
.scanner-hero {
  height: var(--activity-hub-hero-only);
}

/* Activity Hub Content Spacing (below fixed header) */
.activity-hub-content {
  padding-top: var(--activity-hub-hero-only);
}

/* ===================================
   Activity Hub - Single Column Feed
   =================================== */

/* Single Column Feed Container */
.single-column-feed {
  width: 100%;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .single-column-feed {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .single-column-feed {
    padding: 0 2rem;
  }
}

/* ===================================
   Activity Hub - Card Shadow System
   =================================== */

/* Layered Shadow System for Professional Depth */
.shadow-card {
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2),
    0 4px 8px -2px rgba(0, 0, 0, 0.15);
}

.shadow-card-hover {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 8px 16px -2px rgba(0, 0, 0, 0.3),
    0 12px 24px -4px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    0 0 20px -4px rgba(139, 92, 246, 0.3);
}

/* Enhanced new item shadow with violet glow */
.feed-item--new {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 8px 16px -2px rgba(0, 0, 0, 0.3),
    0 12px 24px -4px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(139, 92, 246, 0.4),
    0 0 30px -4px rgba(139, 92, 246, 0.6) !important;
}

/* ===================================
   Activity Hub - Animation Styles
   =================================== */

/* Base Feed Item Styles */
.feed-item,
.activity-card {
  position: relative;
  will-change: transform, opacity;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* New Item Entry Animation */
@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-100px) scale(0.95);
  }
  60% {
    transform: translateY(10px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    border-color: rgba(139, 92, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 40px 5px rgba(139, 92, 246, 0.6);
    border-color: rgba(139, 92, 246, 1);
  }
}

/* New Item State */
.feed-item--new {
  animation:
    slideInFromTop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    pulseGlow 2s ease-in-out 2;
  border: 2px solid rgba(139, 92, 246, 0.8) !important;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), transparent) !important;
}

/* Smooth Shifting for Existing Items */
.feed-item--shifting {
  transform: translateY(0);
}

/* ===================================
   Marquee / Ticker Tape Styles
   =================================== */

.marquee-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

/* Marquee Scrolling Animation */
@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-content {
  display: flex;
  align-items: center;
  width: fit-content;
  animation: marqueeScroll 120s linear infinite;
  will-change: transform;
}

/* Pause animation on hover */
.marquee-content:hover {
  animation-play-state: paused;
}

.marquee-item {
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.marquee-item:hover {
  transform: scale(1.05);
  z-index: 10;
}

.marquee-item:focus {
  outline: 2px solid rgba(124, 77, 255, 0.8);
  outline-offset: 2px;
}

/* ===================================
   Fade Transition for Scroll to Top
   =================================== */

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

.fade-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

/* ===================================
   Performance Optimizations
   =================================== */

/* GPU Acceleration for Smooth Animations */
.feed-item,
.marquee-content {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .feed-item--new {
    animation: none !important;
  }

  .marquee-content {
    animation: marqueeScroll 120s linear infinite; /* Slower */
  }

  /* NOTE: .animate-spin exception is handled in design-tokens.css */
  /* Spinners must always animate for usability feedback */
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 640px) {
  .feed-item {
    padding: 1rem;
  }

  .marquee-container {
    font-size: 0.875rem;
  }

  .marquee-item {
    padding: 0.5rem 0.75rem;
  }

  /* Reduce animation intensity on mobile for performance */
  .feed-item--new {
    animation-duration: 0.6s;
  }

  @keyframes slideInFromTop {
    0% {
      opacity: 0;
      transform: translateY(-50px) scale(0.98);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* ===================================
   Dark Mode Enhancements
   =================================== */

/* More prominent glow effects in dark mode */
@media (prefers-color-scheme: dark) {
  .feed-item--new {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), transparent) !important;
  }

  @keyframes pulseGlow {
    0%, 100% {
      box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
      border-color: rgba(139, 92, 246, 0.4);
    }
    50% {
      box-shadow: 0 0 50px 8px rgba(139, 92, 246, 0.8);
      border-color: rgba(139, 92, 246, 1);
    }
  }

  .marquee-container {
    background: linear-gradient(
      to right,
      rgba(139, 92, 246, 0.15),
      rgba(139, 92, 246, 0.08),
      rgba(139, 92, 246, 0.15)
    );
    border-bottom: 1px solid rgba(139, 92, 246, 0.4);
  }
}

/* ===================================
   Container and Layout Utilities
   =================================== */

.container-custom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding: 0 2rem;
  }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .feed-item--new {
    border: 3px solid #7c4dff !important;
  }

  .marquee-item:focus {
    outline-width: 3px;
  }

  .activity-card:focus-visible {
    outline-width: 4px;
  }
}

/* Focus visible styles for keyboard navigation */
.activity-card:focus-visible {
  outline: 3px solid rgba(124, 77, 255, 0.9);
  outline-offset: 2px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 8px 16px -2px rgba(0, 0, 0, 0.3),
    0 12px 24px -4px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(139, 92, 246, 0.3),
    0 0 30px -4px rgba(139, 92, 246, 0.6);
}

.feed-item:focus-visible {
  outline: 3px solid rgba(124, 77, 255, 0.9);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid rgba(124, 77, 255, 0.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.2);
}

/* Interactive element focus states */
.ticker-pill:focus-visible {
  outline: 2px solid rgba(124, 77, 255, 0.9);
  outline-offset: 2px;
}

/* Ensure focus is visible when navigating with keyboard */
.activity-card:focus {
  outline: none;
}

.activity-card:focus-visible {
  outline: 3px solid rgba(124, 77, 255, 0.9);
}

/* ===================================
   Scroll Behavior
   =================================== */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ===================================
   Activity Card Responsive Design
   =================================== */

/* Mobile optimizations (< 640px) */
@media (max-width: 640px) {
  /* Card padding reduction */
  .activity-card .p-5 {
    padding: 1rem !important; /* 16px on mobile */
  }

  .activity-card .flex.gap-4 {
    gap: 0.75rem;
  }

  /* Smaller avatar on mobile */
  .activity-card .w-16.h-16 {
    width: 3.5rem !important; /* 56px */
    height: 3.5rem !important;
  }

  .activity-card .w-7.h-7 {
    width: 1.5rem !important; /* 24px badge */
    height: 1.5rem !important;
  }

  /* Full-width date section spacing on mobile */
  .activity-card .pt-4.mt-4 {
    padding-top: 0.75rem !important; /* 12px instead of 16px */
    margin-top: 0.75rem !important;
  }

  /* Amount text sizing on mobile */
  .activity-card .amount-text {
    font-size: 1.25rem !important; /* 20px instead of 24px */
  }

  /* Stack content on very small screens if needed */
  .activity-card .text-base {
    font-size: 0.9375rem;
  }

  .activity-card .text-sm {
    font-size: 0.8125rem;
  }

  .activity-card .text-xs {
    font-size: 0.6875rem;
  }

  /* Ensure text-2xs is readable on mobile */
  .activity-card .text-2xs {
    font-size: 0.6875rem; /* 11px */
  }
}

/* Tablet (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .activity-card .flex-1.p-4 {
    padding: 1rem;
  }
}

/* Desktop (≥1024px) - Full layout */
@media (min-width: 1024px) {
  .activity-card:hover {
    transform: translateY(-2px);
  }
}

/* ===================================
   Accent Bar Enhancements
   =================================== */

/* Base accent bar styling */
.activity-card .accent-bar {
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Subtle glow effect on hover for accent bars */
.activity-card:hover .accent-bar {
  box-shadow:
    0 0 12px rgba(139, 92, 246, 0.4),
    0 0 24px rgba(139, 92, 246, 0.2);
}

/* Enhanced glow for new items */
.feed-item--new .accent-bar {
  box-shadow:
    0 0 16px rgba(139, 92, 246, 0.6),
    0 0 32px rgba(139, 92, 246, 0.4);
  animation: accentBarPulse 2s ease-in-out infinite;
}

@keyframes accentBarPulse {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 16px rgba(139, 92, 246, 0.6),
      0 0 32px rgba(139, 92, 246, 0.4);
  }
  50% {
    opacity: 0.85;
    box-shadow:
      0 0 20px rgba(139, 92, 246, 0.8),
      0 0 40px rgba(139, 92, 246, 0.5);
  }
}

/* ===================================
   Amount Emphasis Block (Expedia-style)
   =================================== */

.amount-emphasis-block {
  font-size: 1.25rem;          /* 20px - prominent amount */
  font-weight: 800;            /* Extra bold */
  line-height: 1.2;
  padding: 8px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
  min-width: 90px;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.01em;
}

/* Subtle pulse effect for new items */
.feed-item--new .amount-emphasis-block {
  animation: amountPulse 2s ease-in-out 1;
}

@keyframes amountPulse {
  0%, 100% { background: rgba(0, 0, 0, 0.4); }
  50% { background: rgba(139, 92, 246, 0.15); }
}

/* ===================================
   Micro-Interactions & Hover Effects
   =================================== */

/* Logo hover effects */
.activity-card ticker-icon {
  opacity: 0.95;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover ticker-icon {
  opacity: 1;
  transform: scale(1.08);
  filter: brightness(1.1);
}

/* Amount text hover enhancement (clean hero style) */
.activity-card:hover .amount-text {
  transform: scale(1.05);
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Ticker pill hover */
.activity-card:hover .ticker-pill {
  background: rgba(124, 77, 255, 0.3);
  transform: scale(1.05);
}

/* Avatar scale on hover */
.activity-card .avatar-container {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover .avatar-container {
  transform: scale(1.05);
}

/* ===================================
   Enhanced Mobile Responsive
   =================================== */

/* Mobile: Optimize amount block and spacing */
@media (max-width: 640px) {
  /* Reduce card shadow on mobile for performance */
  .shadow-card {
    box-shadow:
      0 1px 2px 0 rgba(0, 0, 0, 0.25),
      0 2px 4px -1px rgba(0, 0, 0, 0.15);
  }

  .shadow-card-hover {
    box-shadow:
      0 3px 5px -1px rgba(0, 0, 0, 0.35),
      0 6px 12px -2px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(139, 92, 246, 0.12),
      0 0 16px -4px rgba(139, 92, 246, 0.25);
  }

  /* Amount text already handled by .amount-text rule above */

  /* Tighter right column on mobile */
  .activity-card .flex-shrink-0.flex.flex-col {
    min-width: 85px;
  }

  /* Reduce hover lift on mobile */
  .activity-card:hover {
    transform: translateY(-0.5px);
  }

  /* Reduce accent bar glow on mobile */
  .activity-card:hover .accent-bar {
    box-shadow:
      0 0 8px rgba(139, 92, 246, 0.3),
      0 0 16px rgba(139, 92, 246, 0.15);
  }
}

/* Tablet: Medium sizing */
@media (min-width: 640px) and (max-width: 1023px) {
  /* Amount text uses default text-2xl (24px) on tablet */
}

/* ===================================
   Badge & Ribbon Redesign (Phase 3)
   =================================== */

/* Inline Badge (replaces overlay badge on avatar) */
.badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.6875rem;  /* 11px */
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover .badge-inline {
  transform: scale(1.1);
}

/* Mobile: Adjust badge sizing */
@media (max-width: 640px) {
  .badge-inline {
    width: 18px;
    height: 18px;
    font-size: 0.625rem; /* 10px */
  }
}

/* ===================================
   NEW Badge (Top-Right)
   =================================== */

.corner-badge-new {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #7c4dff 0%, #6a3de8 100%);
  color: white;
  font-size: 0.625rem; /* 10px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow:
    0 2px 8px rgba(124, 77, 255, 0.4),
    0 4px 16px rgba(124, 77, 255, 0.2);
  z-index: 10;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover enhancement */
.activity-card:hover .corner-badge-new {
  box-shadow:
    0 4px 12px rgba(124, 77, 255, 0.6),
    0 6px 20px rgba(124, 77, 255, 0.3);
  transform: scale(1.05);
}

/* Mobile sizing */
@media (max-width: 640px) {
  .corner-badge-new {
    top: 8px;
    right: 8px;
    font-size: 0.5625rem; /* 9px */
    padding: 3px 8px;
  }
}

/* ===================================
   Transaction Pill Badge (Bottom-Right)
   =================================== */

.transaction-pill {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid;
  transition: all 0.15s ease-out;
  pointer-events: none;
}

.transaction-pill.buy {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.transaction-pill.sell {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.transaction-pill i {
  font-size: 0.625rem; /* 10px */
}

/* Hover enhancement */
.activity-card:hover .transaction-pill.buy {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  transform: scale(1.05);
}

.activity-card:hover .transaction-pill.sell {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

/* Mobile sizing */
@media (max-width: 640px) {
  .transaction-pill {
    bottom: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 0.625rem; /* 10px */
    gap: 4px;
  }

  .transaction-pill i {
    font-size: 0.5625rem; /* 9px */
  }
}

/* ===================================
   Scanner-Style Layout - Custom Scrollbar
   =================================== */

/* Custom scrollbar for filter rail */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #0A0A0B;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #26262B;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #35353A;
}

/* Firefox scrollbar */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #26262B #0A0A0B;
}
