/* Landing Page Animation Styles */

/* Core Animation Variables */
:root {
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Scroll-triggered animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all var(--transition-slow);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all var(--transition-slow);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-slow);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animations for feature cards */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Enhanced card hover effects */
.enhanced-card {
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.enhanced-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.enhanced-card:hover::before {
  left: 100%;
}

.enhanced-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-large);
}

.enhanced-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Icon animations */
.card-icon {
  transition: all var(--transition-bounce);
}

.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Typing animation */
.typing-animation {
  overflow: hidden;
  border-right: 3px solid #003366;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #003366; }
}

/* Counter animations */
.counter {
  transition: all var(--transition-slow);
}

/* Button enhancements */
.enhanced-button {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.enhanced-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.enhanced-button:active::before {
  width: 300px;
  height: 300px;
}

.enhanced-button:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

/* Floating elements */
.floating {
  animation: float 3s ease-in-out infinite;
}

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

.floating-delayed {
  animation: float 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* Background pattern animations */
.animated-pattern {
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.3) 1px, transparent 0);
  background-size: 40px 40px;
  animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}

/* Progress indicators */
.progress-circle {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 2s ease-in-out;
}

.progress-circle.animate {
  stroke-dashoffset: 56.6; /* 80% progress */
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Progress bar animations */
.progress-fill {
  transition: width 0.1s ease-out, background-color 0.3s ease-out;
}

/* AI review text formatting */
.ai-review-text {
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.ai-review-text strong {
  font-weight: 600;
  color: #1f2937;
}

/* Scrollbar styling for review text */
.ai-review-text::-webkit-scrollbar {
  width: 4px;
}

.ai-review-text::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.ai-review-text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.ai-review-text::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile-specific animations */
@media (max-width: 768px) {
  .fade-in-up {
    transform: translateY(20px);
  }
  
  .enhanced-card:hover {
    transform: translateY(-8px);
  }
  
  .floating {
    animation-duration: 4s;
  }
}

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

/* Demo portfolio styles */
.portfolio-demo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.portfolio-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  transform: translateY(20px);
  opacity: 0;
}

.portfolio-item.visible {
  transform: translateY(0);
  opacity: 1;
}

.ai-review-popup {
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.ai-review-popup.visible {
  transform: translateX(0);
}

.typing-text {
  border-right: 2px solid #10B981;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { border-color: transparent; }
  51%, 100% { border-color: #10B981; }
}

/* KSB demo styles */
.ksb-demo {
  position: relative;
  min-height: 400px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ksb-input-demo {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.ksb-ai-output {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  transform: scale(0);
  transition: transform var(--transition-bounce);
}

.ksb-ai-output.visible {
  transform: scale(1);
}

/* Apprenticeship Selector Styles */
.apprenticeship-selector {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.apprenticeship-selector:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px);
}

.apprenticeship-selector.active {
  background: rgba(255, 255, 255, 0.9);
  color: #003366;
  font-weight: 600;
  box-shadow: var(--shadow-medium);
}

.apprenticeship-selector.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #003366, #3B82F6);
  border-radius: 4px 4px 0 0;
}

/* Mobile responsive styles for apprenticeship selector */
@media (max-width: 768px) {
  .apprenticeship-selector {
    padding: 8px 10px !important;
    font-size: 0.75rem !important;
    min-width: 80px;
    text-align: center;
  }
  
  .apprenticeship-selector i {
    margin-bottom: 2px !important;
    margin-right: 4px !important;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .apprenticeship-selector {
    padding: 6px 8px !important;
    font-size: 0.7rem !important;
    min-width: 70px;
  }
  
  .apprenticeship-selector i {
    font-size: 0.75rem;
    margin-right: 2px !important;
  }
}

/* Extra small screens - stack vertically */
@media (max-width: 360px) {
  .apprenticeship-selector {
    width: 100%;
    margin-bottom: 4px;
    padding: 8px 12px !important;
  }
}

/* Ripple effect for selector buttons */
.apprenticeship-selector .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Demo status indicator */
#typing-status {
  transition: all var(--transition-normal);
}

#typing-status.active {
  color: #10B981;
  font-weight: 500;
}
