/* ==========================================================================
   Collaborative Approach Page - Interactive Elements
   Hormone Therapy Website
   ========================================================================== */

/* === Scroll Animations === */
/* Elements that animate on scroll */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

[data-animate="fade-left"].in-view {
    transform: translateX(0);
}

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

[data-animate="fade-right"].in-view {
    transform: translateX(0);
}

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

[data-animate="scale"].in-view {
    transform: scale(1);
}

/* Stagger animations for lists */
[data-animate-delay="100"] {
    transition-delay: 0.1s;
}

[data-animate-delay="200"] {
    transition-delay: 0.2s;
}

[data-animate-delay="300"] {
    transition-delay: 0.3s;
}

[data-animate-delay="400"] {
    transition-delay: 0.4s;
}

[data-animate-delay="500"] {
    transition-delay: 0.5s;
}

/* === Hero Section Animations === */
.hero-section {
    position: relative;
}

/* Floating particles background */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

/* Animated gradient background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-section {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* === Interactive Pillar Cards === */
.pillar-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Ripple effect on click */
.pillar-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(146, 110, 204, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.pillar-card.clicked::after {
    width: 600px;
    height: 600px;
}

/* Icon animation */
.pillar-icon {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pillar-card:hover .pillar-icon {
    transform: rotateY(180deg) scale(1.1);
}

.pillar-icon svg {
    transition: transform 0.4s ease;
}

.pillar-card:hover .pillar-icon svg {
    transform: scale(1.2);
}

/* === Process Timeline Interactive === */
.process-step {
    cursor: pointer;
}

/* Animated connecting line */
@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.process-timeline::after {
    content: '';
    position: absolute;
    top: 4rem;
    left: 10%;
    height: 2px;
    background: var(--main-gradient);
    width: 0;
    animation: lineGrow 2s ease forwards;
    animation-delay: 0.5s;
    z-index: 0;
}

/* Step number pulse effect */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(146, 110, 204, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(146, 110, 204, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(146, 110, 204, 0);
    }
}

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

.process-step:hover .step-number {
    animation: none;
}

/* Step content reveal */
.process-step p {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.process-step.active p {
    max-height: 200px;
    opacity: 1;
    padding-top: 1rem;
}

/* === Trust Indicators Counter Animation === */
.indicator-value {
    display: inline-block;
}

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

.indicator-value[data-count] {
    animation: countUp 0.8s ease forwards;
}

/* === Interactive Benefits Cards === */
.benefit-card {
    cursor: pointer;
    position: relative;
}

/* 3D tilt effect */
.benefit-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(146, 110, 204, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--border-radius-lg);
}

.benefit-card:hover::before {
    opacity: 1;
}

/* Icon rotation */
.benefit-icon {
    transition: transform 0.5s ease;
}

.benefit-card:hover .benefit-icon {
    transform: rotateZ(360deg);
}

/* === Technology Cards Interactive === */
.tech-card {
    position: relative;
    overflow: hidden;
}

/* Scanning effect */
@keyframes scan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(146, 110, 204, 0.1) 50%, transparent 100%);
    transform: translateY(-100%);
    transition: transform 0.5s ease;
}

.tech-card:hover::before {
    animation: scan 1.5s ease infinite;
}

/* === Success Stories Interactive === */
.patient-story {
    position: relative;
    transition: all 0.4s ease;
}

/* Quote mark animation */
.patient-story::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 6rem;
    color: rgba(146, 110, 204, 0.1);
    font-family: Georgia, serif;
    transition: all 0.4s ease;
}

.patient-story:hover::before {
    color: rgba(146, 110, 204, 0.3);
    transform: scale(1.2);
}

/* === FAQ Accordion === */
.faq-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item h3 {
    position: relative;
    padding-right: 3rem;
}

/* Plus/minus icon */
.faq-item h3::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.4rem;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.faq-item.open h3::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-item p {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.faq-item.open p {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
}

/* === CTA Section Interactive === */
/* Animated background pattern */
@keyframes patternMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 60px 60px;
    }
}

.cta-section::before {
    animation: patternMove 10s linear infinite;
}

/* Button glow effect */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover::before {
    left: 100%;
}

.cta-section .btn-primary {
    animation: glow 3s ease infinite;
}

/* === Smooth Scroll Behavior === */
html {
    scroll-behavior: smooth;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 5rem;
    height: 5rem;
    background: var(--main-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* === Loading States === */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* === Tooltips === */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--color-primary-dark);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 1.2rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-primary-dark);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* === Focus Styles for Accessibility === */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 3px;
    border-radius: var(--border-radius-sm);
}

.btn:focus-visible {
    outline-offset: 5px;
}

/* === Print Animations Override === */
@media print {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

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

/* === Dark Mode Support (if implemented) === */
@media (prefers-color-scheme: dark) {
    /* Add dark mode specific interactive styles here */
}

/* === Mobile Touch Interactions === */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .pillar-card:hover,
    .benefit-card:hover,
    .tech-card:hover {
        transform: none;
    }
    
    /* Add touch feedback */
    .pillar-card:active,
    .benefit-card:active,
    .btn:active {
        transform: scale(0.98);
    }
}
