/* ==========================================================================
   CVAI Animations Stylesheet
   Using GSAP-compatible classes and CSS animations
   ========================================================================== */

/* ==========================================================================
   Fade Animations
   ========================================================================== */

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="scale-up"] {
    transform: scale(0.9);
}

/* Stagger delays */
[data-delay="0.1"] { transition-delay: 0.1s; }
[data-delay="0.2"] { transition-delay: 0.2s; }
[data-delay="0.3"] { transition-delay: 0.3s; }
[data-delay="0.4"] { transition-delay: 0.4s; }
[data-delay="0.5"] { transition-delay: 0.5s; }

/* ==========================================================================
   Hero Animations
   ========================================================================== */

.hero-title-line {
    opacity: 0;
    transform: translateY(50px);
    animation: heroFadeUp 0.8s ease forwards;
}

.hero-title-line:nth-child(1) { animation-delay: 0.2s; }
.hero-title-line:nth-child(2) { animation-delay: 0.4s; }
.hero-title-line:nth-child(3) { animation-delay: 0.6s; }

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 1s;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Button Hover Effects
   ========================================================================== */

.hero-cta,
.nav-cta,
.form-submit,
.persona-cta,
.cta-primary {
    position: relative;
    overflow: hidden;
}

.hero-cta::before,
.nav-cta::before,
.form-submit::before,
.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hero-cta:hover::before,
.nav-cta:hover::before,
.form-submit:hover::before,
.cta-primary:hover::before {
    left: 100%;
}

/* ==========================================================================
   Card Hover Effects
   ========================================================================== */

.credibility-card,
.offering-card,
.industry-card,
.persona-card,
.gap-card {
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.credibility-card:hover,
.offering-card:hover,
.industry-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.persona-card:hover {
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Pulse Animation
   ========================================================================== */

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

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

/* ==========================================================================
   Typing Indicator (AI Thinking)
   ========================================================================== */

.typing-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-gray-500);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Progress Journey Animation
   ========================================================================== */

.journey-step {
    transition: all 0.4s ease;
}

.journey-step.active .step-icon {
    transform: scale(1.2);
    background: var(--color-white);
    color: var(--color-black);
}

.journey-step.completed .step-icon {
    background: var(--color-success);
    color: var(--color-white);
}

.journey-line {
    transition: background 0.6s ease;
}

.journey-line.active {
    background: linear-gradient(90deg, var(--color-success), var(--color-gray-700));
}

.journey-line.completed {
    background: var(--color-success);
}

/* ==========================================================================
   Question Card Transitions
   ========================================================================== */

.question-card {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.question-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.question-card.exit {
    opacity: 0;
    transform: translateX(-50px);
}

/* Option selection animation */
.question-option {
    transition: all 0.3s ease;
}

.question-option:hover {
    transform: translateX(10px);
    border-color: var(--color-white);
}

.question-option.selected {
    background: var(--color-white);
    color: var(--color-black);
    transform: scale(1.02);
}

.question-option.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    font-weight: bold;
}

/* ==========================================================================
   Loading Animations
   ========================================================================== */

.loading-animation {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: var(--spacing-6);
}

.loading-circle {
    width: 20px;
    height: 20px;
    background: var(--color-gray-700);
    border-radius: 50%;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-circle:nth-child(1) { animation-delay: 0s; }
.loading-circle:nth-child(2) { animation-delay: 0.2s; }
.loading-circle:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingPulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Results reveal animation */
.results-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.results-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Fit Score Badge Animation
   ========================================================================== */

.fit-score {
    animation: fitScoreReveal 0.8s ease forwards;
}

@keyframes fitScoreReveal {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Modal Animation
   ========================================================================== */

.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   Video Placeholder Shimmer
   ========================================================================== */

.video-placeholder {
    position: relative;
    overflow: hidden;
}

.video-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==========================================================================
   Smooth Scroll Snap (for diagnostic journey)
   ========================================================================== */

.diagnostic-container {
    scroll-snap-type: y proximity;
}

.question-container {
    scroll-snap-align: center;
}

/* ==========================================================================
   Text Reveal Animation
   ========================================================================== */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.6s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* ==========================================================================
   Confetti Animation (for diagnostic completion)
   ========================================================================== */

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--color-success);
    animation: confetti 3s ease-out forwards;
}
