/**
 * animations.css - Trouwmuziek Theme Animations
 * Smooth transitions, hover effects, entrance animations
 */

/* ===========================
   KEYFRAME ANIMATIONS
   =========================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(196, 30, 58, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Flip */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* ===========================
   ENTRANCE ANIMATIONS
   =========================== */

/* Hero Section */
.hero {
    animation: fadeIn 0.8s ease-out;
}

.hero-title {
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-description {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* Section Headers */
.section-header h2 {
    animation: fadeInUp 0.6s ease-out;
}

.section-header p {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Cards Staggered */
.offering-card {
    animation: fadeInUp 0.6s ease-out;
}

.offering-card:nth-child(1) {
    animation-delay: 0s;
}

.offering-card:nth-child(2) {
    animation-delay: 0.1s;
}

.offering-card:nth-child(3) {
    animation-delay: 0.2s;
}

.offering-card:nth-child(4) {
    animation-delay: 0.3s;
}

.offering-card:nth-child(5) {
    animation-delay: 0.4s;
}

.offering-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* Formula Cards */
.formula-card {
    animation: fadeInUp 0.6s ease-out;
}

.formula-card:nth-child(1) {
    animation-delay: 0s;
}

.formula-card:nth-child(2) {
    animation-delay: 0.1s;
}

.formula-card:nth-child(3) {
    animation-delay: 0.2s;
}

.formula-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Testimonial Cards */
.testimonial-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Story Section */
.story-text {
    animation: slideInLeft 0.6s ease-out;
}

.story-stats {
    animation: slideInRight 0.6s ease-out;
}

.stat-card {
    animation: scaleIn 0.6s ease-out;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* CTA Section */
.cta-content {
    animation: fadeInUp 0.6s ease-out;
}

.cta-buttons {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ===========================
   HOVER EFFECTS
   =========================== */

/* Buttons */
.btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary:hover {
    background-color: #a01830;
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.4);
}

.btn-secondary:hover {
    background-color: #1a2a3a;
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.3);
}

/* Cards */
.offering-card,
.formula-card,
.testimonial-card,
.stat-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.offering-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.formula-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Icons */
.offering-icon {
    transition: all 0.3s ease-out;
}

.offering-card:hover .offering-icon {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary-color);
}

/* Links */
a {
    transition: color 0.3s ease-out;
}

a:hover {
    color: var(--primary-color);
}

nav a:hover {
    color: var(--primary-color);
}

footer a:hover {
    color: var(--primary-color);
}

/* ===========================
   INTERACTIVE ELEMENTS
   =========================== */

/* Input Focus */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
select {
    transition: all 0.3s ease-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
    transform: scale(1.01);
}

/* ===========================
   LOADING ANIMATIONS
   =========================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(196, 30, 58, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* Pulse Loading */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===========================
   SPECIAL EFFECTS
   =========================== */

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Bounce Effect */
.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Sticky Contact Button Animation */
.sticky-contact-btn {
    animation: slideInUp 0.5s ease-out;
}

.sticky-contact-btn:hover {
    animation: bounce 1s ease-in-out infinite;
}

/* ===========================
   TRANSITION UTILITIES
   =========================== */

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.transition-fast {
    transition: all 0.15s ease-out;
}

.transition-slow {
    transition: all 0.6s ease-out;
}

.transition-smooth {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

/* Fade In on Scroll */
.fade-in-scroll {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Slide In on Scroll */
.slide-in-scroll {
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

/* Scale In on Scroll */
.scale-in-scroll {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

/* ===========================
   MOBILE ANIMATIONS
   =========================== */

@media (max-width: 767px) {
    /* Reduce animations on mobile for better performance */
    * {
        animation-duration: 0.4s !important;
    }

    /* Simpler hover effects */
    .offering-card:hover,
    .formula-card:hover,
    .testimonial-card:hover,
    .stat-card:hover {
        transform: none;
    }

    /* Faster transitions */
    .btn,
    .offering-card,
    .formula-card,
    .testimonial-card,
    .stat-card {
        transition: all 0.2s ease-out;
    }

    .btn:hover {
        transform: none;
    }

    /* Disable some animations */
    .hero-title,
    .hero-subtitle,
    .hero-description,
    .hero-buttons {
        animation: fadeIn 0.6s ease-out !important;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn:hover {
        transform: none;
    }

    .offering-card:hover,
    .formula-card:hover,
    .testimonial-card:hover,
    .stat-card:hover {
        transform: none;
    }
}

/* ===========================
   DARK MODE ANIMATIONS
   =========================== */

@media (prefers-color-scheme: dark) {
    /* Adjust glow colors for dark mode */
    .glow {
        animation: glow 2s ease-in-out infinite;
    }

    /* Adjust shadows for dark mode */
    .btn:hover {
        box-shadow: 0 8px 20px rgba(196, 30, 58, 0.5);
    }

    .offering-card:hover,
    .formula-card:hover,
    .testimonial-card:hover,
    .stat-card:hover {
        box-shadow: 0 12px 30px rgba(255, 255, 255, 0.1);
    }
}

/* ===========================
   ADVANCED EFFECTS
   =========================== */

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Text Reveal */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease-out;
}

/* Number Counter */
@keyframes countUp {
    from {
        counter-increment: count 0;
    }
    to {
        counter-increment: count var(--target);
    }
}

/* Stagger Animation Helper */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* ===========================
   BUTTON RIPPLE EFFECT
   =========================== */

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.btn:active::before {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ===========================
   PAGE TRANSITION
   =========================== */

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageEnter 0.5s ease-out;
}

/* ===========================
   SMOOTH SCROLLBAR
   =========================== */

html {
    scroll-behavior: smooth;
}

/* ===========================
   FOCUS VISIBLE
   =========================== */

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}