/* Additional Animations & Effects */

/* Smooth transitions for all interactive elements */
* {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Fade-in animation for elements */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Slide-in from right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

/* Slide-in from bottom */
@keyframes slideInBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-bottom {
  animation: slideInBottom 0.3s ease-out;
}

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

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

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* Shimmer effect for loading */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s linear infinite;
}

/* Glow effect */
.glow {
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.5);
}

.glow-hover:hover {
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.7);
}

/* Hide scrollbar completely */
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-track {
  display: none;
}

::-webkit-scrollbar-thumb {
  display: none;
}

/* Firefox scrollbar hidden */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Floating animation for avatars */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

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

/* Typing indicator */
@keyframes typing {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.typing-indicator span {
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Spinner loading animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.4);
  border-top-color: #40E0D0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Slide down from top */
@keyframes slideDown {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

/* Slide up to top */
@keyframes slideUp {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
}

/* Blink animation for pause icon */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.blink {
  animation: blink 1s infinite;
}

/* Stats card animations */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fillCircle {
  from {
    stroke-dashoffset: 565;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fillBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(64, 224, 208, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(64, 224, 208, 0.5);
  }
}

.stat-card {
  animation: countUp 0.6s ease-out;
}

.stat-card:nth-child(2) {
  animation-delay: 0.1s;
  animation-fill-mode: both;
}

.stat-card:nth-child(3) {
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

.stat-card:nth-child(4) {
  animation-delay: 0.3s;
  animation-fill-mode: both;
}

/* Animated gradient border for memory card thumbnail */
@keyframes gradient-rotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.memory-card-thumbnail::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: linear-gradient(
    45deg,
    #FF0080,
    #FF8C00,
    #40E0D0,
    #FF0080,
    #7928CA,
    #FF0080
  );
  background-size: 300% 300%;
  animation: gradient-rotate 3s ease infinite;
  z-index: -1;
}

.memory-card-thumbnail {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
}

/* Animated gradient border with glow effect for export modal memory card only */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spinBorder {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}

#export-screen .memory-card {
  background: #1a1a1a;
}

#export-screen .memory-card::after,
#export-screen .memory-card::before {
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;
  background-image: conic-gradient(from var(--angle), #ff4545, #00ff99, #006aff, #ff0095, #ff4545);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  padding: 2px;
  border-radius: 18px;
  animation: 3s spin linear infinite;
}

#export-screen .memory-card::before {
  filter: blur(0.8rem);
  opacity: 0.5;
}

/* Zoom in animation for modals */
@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Fade out animation */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Voice mode active animation */
@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(64, 224, 208, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(64, 224, 208, 0);
    transform: scale(1.05);
  }
}

.voice-active {
  animation: voicePulse 2s ease-in-out infinite !important;
}
