/* ===== JURISCONNECT — ANIMATIONS ===== */

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Slide animations */
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

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

/* Special animations */
@keyframes heart-beat {
  0% { transform: scale(1); }
  25% { transform: scale(1.35); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(26,108,240,0.2); }
  50% { box-shadow: 0 0 40px rgba(26,108,240,0.5); }
}

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

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

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

@keyframes typing-dots {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes notification-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes story-progress {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes parallax-slow {
  0% { transform: translateY(0px) scale(1.05); }
  100% { transform: translateY(-20px) scale(1.05); }
}

/* Transition classes */
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-fade-up { animation: fadeInUp 0.4s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }

/* Stagger animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* Hover micro interactions */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(26,108,240,0.4);
}

.hover-scale {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* ===== STORY VIEWER ===== */
.story-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.story-viewer {
  width: 100%;
  max-width: 420px;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.story-progress-bar {
  display: flex;
  gap: 4px;
  padding: 12px 16px 8px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.story-progress-segment {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: white;
  width: 0%;
}

.story-progress-fill.active {
  animation: story-progress 5s linear forwards;
}

.story-progress-fill.done {
  width: 100%;
}

.story-content {
  width: 100%;
  height: 100vh;
  object-fit: cover;
  display: block;
}

.story-content-text {
  width: 100%;
  height: 100vh;
  background: var(--gradient-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  font-size: 22px;
  text-align: center;
  line-height: 1.5;
}

.story-header {
  position: absolute;
  top: 40px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.story-close-btn {
  position: absolute;
  top: 40px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  z-index: 11;
}

.story-nav-left, .story-nav-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  cursor: pointer;
  z-index: 9;
}

.story-nav-left { left: 0; }
.story-nav-right { right: 0; }

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--black-3);
  border-radius: var(--radius-xl);
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--gray-3);
  border-radius: var(--radius-full);
}

.typing-dot:nth-child(1) { animation: typing-dots 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation: typing-dots 1.2s ease-in-out 0.2s infinite; }
.typing-dot:nth-child(3) { animation: typing-dots 1.2s ease-in-out 0.4s infinite; }

/* ===== RIPPLE EFFECT ===== */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ===== WELCOME ANIMATIONS ===== */
.welcome-title-line {
  overflow: hidden;
}

.welcome-title-text {
  display: block;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-fill-mode: both;
}

.welcome-subtitle {
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.welcome-buttons {
  animation: fadeInUp 0.8s ease 0.7s forwards;
  opacity: 0;
}

.welcome-badges {
  animation: fadeInUp 0.8s ease 1s forwards;
  opacity: 0;
}

/* ===== PLAN CARD HOVER ===== */
.plan-card {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover {
  transform: translateY(-8px);
}

.plan-card.featured:hover {
  box-shadow: 0 20px 60px rgba(26,108,240,0.3);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--black-4);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ===== PARALLAX HERO ===== */
.parallax-bg {
  animation: parallax-slow 20s ease-in-out infinite alternate;
}

/* ===== METRIC CARDS ===== */
.metric-card {
  background: var(--black-2);
  border: 1px solid var(--black-4);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 13px;
  color: var(--gray-3);
  font-weight: 500;
}

.metric-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-change.up { color: var(--green); }
.metric-change.down { color: var(--red); }
