/* ============================================
   LEIDERS INZICHT - GEFIXTE PARALLAX ANIMATIES
   Bestand: public/css/parallax-fixed.css (NIEUW BESTAND)
   Doel: Herstel parallax effecten met CMS controle
   ============================================ */

/* ============================================
   PARALLAX CORE SYSTEEM
   ============================================ */

/* Base parallax container */
.section-animation[data-parallax="true"] {
    position: relative;
    overflow: hidden;
}

/* Background parallax layers */
.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 120%;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    z-index: -1;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* Content parallax effect */
.parallax-content {
    position: relative;
    z-index: 2;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ============================================
   TESTIMONIALS PARALLAX EFFECTEN
   ============================================ */

/* Testimonials parallax container */
.testimonials-section.parallax-enabled {
    /*background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);*/
    position: relative;
    overflow: hidden;
}

.testimonials-section.parallax-enabled::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    /*background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);*/
    z-index: 1;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* Testimonial cards parallax */
.testimonials-section.parallax-enabled .testimonial-card {
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonials-section.parallax-enabled .testimonial-card:nth-child(odd) {
    transform: translateY(0) translateZ(0);
}

.testimonials-section.parallax-enabled .testimonial-card:nth-child(even) {
    transform: translateY(0) translateZ(0);
}

/* ============================================
   METHODIEKEN PARALLAX EFFECTEN
   ============================================ */

/* Methodieken parallax container */
.methodieken-section.parallax-enabled {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.methodieken-section.parallax-enabled::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.methodieken-section.parallax-enabled .container {
    position: relative;
    z-index: 2;
}

/* Methodiek cards parallax */
.methodieken-section.parallax-enabled .methodiek-card {
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Parallax scroll effect voor cards */
.methodieken-section.parallax-enabled.parallax-scrolling .methodiek-card:nth-child(odd) {
    transform: translateY(var(--parallax-y-odd, 0)) translateZ(0);
}

.methodieken-section.parallax-enabled.parallax-scrolling .methodiek-card:nth-child(even) {
    transform: translateY(var(--parallax-y-even, 0)) translateZ(0);
}

/* ============================================
   HERO PARALLAX EFFECTEN
   ============================================ */

.hero-section.parallax-enabled {
    position: relative;
    overflow: hidden;
}

.hero-section.parallax-enabled .hero-video {
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ============================================
   PARALLAX UTILITIES
   ============================================ */

/* Smooth scrolling for parallax */
html.parallax-smooth {
    scroll-behavior: smooth;
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    .parallax-bg,
    .parallax-content,
    .section-animation[data-parallax="true"]::before {
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }
    
    .testimonials-section.parallax-enabled::before,
    .methodieken-section.parallax-enabled::before {
        transform: none !important;
    }
    
    .testimonials-section.parallax-enabled .testimonial-card,
    .methodieken-section.parallax-enabled .methodiek-card {
        transform: none !important;
    }
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
    .parallax-bg,
    .parallax-content,
    .testimonials-section.parallax-enabled::before,
    .methodieken-section.parallax-enabled::before,
    .testimonials-section.parallax-enabled .testimonial-card,
    .methodieken-section.parallax-enabled .methodiek-card {
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }
}

/* ============================================
   FLOATING ANIMATIONS (ALTERNATIVE TO PARALLAX)
   ============================================ */

/* Subtle floating voor als parallax uit staat */
.methodiek-card:not(.parallax-card) {
    animation: subtleFloat 6s ease-in-out infinite;
}

.methodiek-card:not(.parallax-card):nth-child(even) {
    animation-delay: 3s;
}

@keyframes subtleFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-3px) scale(1.005); 
    }
}

/* Hover effecten */
.methodiek-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonial-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   PARALLAX PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Force hardware acceleration */
.parallax-enabled {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.parallax-enabled * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize for 60fps */
.parallax-element {
    will-change: transform;
    contain: layout style paint;
}

/* ============================================
   DEBUG MODE (DEVELOPMENT ONLY)
   ============================================ */

.debug-parallax {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

body.debug-mode .debug-parallax {
    display: block;
}

/* ============================================
   CMS TOGGLE CLASSES
   ============================================ */

/* Parallax completely disabled */
.section-animation[data-parallax="false"] .parallax-bg,
.section-animation[data-parallax="false"]::before {
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
}

/* Parallax enabled but subtle */
.section-animation[data-animation="parallax-subtle"] {
    --parallax-strength: 0.3;
}

/* Parallax enabled medium */
.section-animation[data-animation="parallax-medium"] {
    --parallax-strength: 0.5;
}

/* Parallax enabled strong */
.section-animation[data-animation="parallax-strong"] {
    --parallax-strength: 1.0;
}

/* Apply parallax strength */
.methodieken-section.parallax-scrolling .methodiek-card:nth-child(odd) {
    transform: translateY(calc(var(--parallax-y-odd, 0px) * var(--parallax-strength, 0.5))) translateZ(0);
}

.methodieken-section.parallax-scrolling .methodiek-card:nth-child(even) {
    transform: translateY(calc(var(--parallax-y-even, 0px) * var(--parallax-strength, 0.5))) translateZ(0);
}

/* ============================================
   FIX TESTIMONIALS ROTATIE - EMERGENCY PATCH
   Voeg toe aan public/css/parallax-fixed.css (onderaan)
   ============================================ */

/* RESET ALLE ROTATIE EFFECTEN OP TESTIMONIALS */
.testimonials-section .testimonial-card {
    transform: none !important; /* Force reset alle transforms */
    animation: none !important; /* Stop alle animaties */
}

.testimonials-section.parallax-enabled .testimonial-card {
    transform: translateY(0) !important; /* Alleen verticale beweging toegestaan */
    /* Geen rotate() meer! */
}

/* SUBTIEL PARALLAX VOOR TESTIMONIALS - ALLEEN VERTICAL */
.testimonials-section.parallax-scrolling .testimonial-card:nth-child(odd) {
    transform: translateY(var(--parallax-y-odd, 0px)) !important;
}

.testimonials-section.parallax-scrolling .testimonial-card:nth-child(even) {
    transform: translateY(var(--parallax-y-even, 0px)) !important;
}

/* VERWIJDER FLOATING ANIMATIONS OP TESTIMONIALS */
.testimonial-card:nth-child(odd),
.testimonial-card:nth-child(even) {
    animation: none !important;
}

/* ALLEEN HOVER EFFECT BEHOUDEN */
.testimonial-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
}

/* CAROUSEL FUNCTIONALITEIT INTACT HOUDEN */
.testimonials-carousel .testimonial-card {
    transform: none !important; /* Laat carousel zijn eigen transforms doen */
}

.testimonials-carousel .testimonial-card.active {
    transform: none !important;
}

/* DEBUG: Force rechte kaarten */
.testimonial-card * {
    transform: none !important;
}

/* PARALLAX ALLEEN OP ACHTERGROND, NIET OP CARDS */
.testimonials-section.parallax-enabled::before {
    /* Alleen achtergrond mag bewegen */
    will-change: transform;
}

.testimonials-section.parallax-enabled .testimonial-card {
    /* Cards blijven recht */
    will-change: auto !important;
}

/* ============================================
   ENHANCED PARALLAX EFFECTS - V2.0
   Voeg toe aan: public/css/parallax-fixed.css
   ============================================ */

/* ============================================
   NIEUWE PARALLAX BEWEGINGSRICHTINGEN
   ============================================ */

/* Base parallax element with custom properties */
.parallax-element-enhanced {
    --start-opacity: 0;
    --end-opacity: 1;
    --animation-speed: 1.5s;
    --start-offset: 50px;
    --trigger-start: 30%;
    --trigger-end: 80%;
    
    will-change: transform, opacity;
    transition: all var(--animation-speed) cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* SLIDE EFFECTS */
.parallax-slide-left {
    transform: translateX(var(--start-offset)) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-slide-left.active {
    transform: translateX(0) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

.parallax-slide-right {
    transform: translateX(calc(-1 * var(--start-offset))) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-slide-right.active {
    transform: translateX(0) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

.parallax-slide-up {
    transform: translateY(var(--start-offset)) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-slide-up.active {
    transform: translateY(0) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

.parallax-slide-down {
    transform: translateY(calc(-1 * var(--start-offset))) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-slide-down.active {
    transform: translateY(0) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

/* ZOOM EFFECTS */
.parallax-zoom-in {
    transform: scale(0.7) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-zoom-in.active {
    transform: scale(1) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

.parallax-zoom-out {
    transform: scale(1.3) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-zoom-out.active {
    transform: scale(1) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

/* FADE EFFECT */
.parallax-fade-in {
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-fade-in.active {
    opacity: calc(var(--end-opacity) / 100);
}

/* ROTATE EFFECT */
.parallax-rotate-in {
    transform: rotate(-180deg) scale(0.8) translateZ(0);
    opacity: calc(var(--start-opacity) / 100);
}

.parallax-rotate-in.active {
    transform: rotate(0deg) scale(1) translateZ(0);
    opacity: calc(var(--end-opacity) / 100);
}

/* CLASSIC PARALLAX */
.parallax-classic {
    position: relative;
}

.parallax-classic::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background: inherit;
    will-change: transform;
    z-index: -1;
}

.parallax-classic.active::before {
    transform: translateY(calc(var(--start-offset) * -0.5)) translateZ(0);
}

/* ============================================
   INTERSECTION OBSERVER STATES
   ============================================ */

/* Element is entering viewport */
.parallax-entering {
    transition-delay: 0s;
}

/* Element is in active zone */
.parallax-active {
    transition-delay: 0s;
}

/* Element is leaving viewport */
.parallax-leaving {
    transition-delay: 0.2s;
}

/* ============================================
   PROGRESSIVE ANIMATION STATES
   ============================================ */

/* Progressive opacity based on scroll position */
.parallax-progressive {
    opacity: var(--scroll-opacity, 0);
}

/* Progressive transform based on scroll position */
.parallax-transform-progressive {
    transform: 
        translateX(var(--scroll-x, 0)) 
        translateY(var(--scroll-y, 0)) 
        scale(var(--scroll-scale, 1)) 
        rotate(var(--scroll-rotate, 0deg))
        translateZ(0);
}

/* ============================================
   SECTION-SPECIFIC ENHANCED PARALLAX
   ============================================ */

/* Enhanced Testimonials Parallax */
.testimonials-section.parallax-enhanced {
    position: relative;
    overflow: hidden;
}

.testimonials-section.parallax-enhanced .testimonial-card {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Enhanced Methodieken Parallax */
.methodieken-section.parallax-enhanced {
    position: relative;
    overflow: hidden;
}

.methodieken-section.parallax-enhanced .methodiek-card {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Staggered animation for multiple cards */
.methodieken-section.parallax-enhanced .methodiek-card:nth-child(1) {
    transition-delay: 0s;
}

.methodieken-section.parallax-enhanced .methodiek-card:nth-child(2) {
    transition-delay: 0.1s;
}

.methodieken-section.parallax-enhanced .methodiek-card:nth-child(3) {
    transition-delay: 0.2s;
}

.methodieken-section.parallax-enhanced .methodiek-card:nth-child(4) {
    transition-delay: 0.3s;
}

.testimonials-section.parallax-enhanced .testimonial-card:nth-child(1) {
    transition-delay: 0s;
}

.testimonials-section.parallax-enhanced .testimonial-card:nth-child(2) {
    transition-delay: 0.15s;
}

.testimonials-section.parallax-enhanced .testimonial-card:nth-child(3) {
    transition-delay: 0.3s;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU Acceleration for all parallax elements */
.parallax-element-enhanced,
.parallax-slide-left,
.parallax-slide-right,
.parallax-slide-up,
.parallax-slide-down,
.parallax-zoom-in,
.parallax-zoom-out,
.parallax-fade-in,
.parallax-rotate-in {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize for 60fps animations */
.parallax-smooth {
    will-change: transform, opacity;
    contain: layout style paint;
}

/* ============================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================ */

/* Disable complex parallax on mobile unless explicitly enabled */
@media (max-width: 768px) {
    .parallax-element-enhanced:not(.mobile-enabled),
    .parallax-slide-left:not(.mobile-enabled),
    .parallax-slide-right:not(.mobile-enabled),
    .parallax-slide-up:not(.mobile-enabled),
    .parallax-slide-down:not(.mobile-enabled),
    .parallax-zoom-in:not(.mobile-enabled),
    .parallax-zoom-out:not(.mobile-enabled),
    .parallax-rotate-in:not(.mobile-enabled) {
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
        will-change: auto !important;
    }
    
    /* Keep fade-in on mobile as it's performance-friendly */
    .parallax-fade-in {
        /* Allow fade effects on mobile */
    }
}

/* ============================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .parallax-element-enhanced,
    .parallax-slide-left,
    .parallax-slide-right,
    .parallax-slide-up,
    .parallax-slide-down,
    .parallax-zoom-in,
    .parallax-zoom-out,
    .parallax-rotate-in {
        transform: none !important;
        transition: opacity 0.3s ease !important;
        animation: none !important;
    }
    
    /* Only allow opacity changes for reduced motion */
    .parallax-fade-in {
        transition: opacity 0.3s ease !important;
    }
}

/* ============================================
   DEBUG MODE ENHANCEMENTS
   ============================================ */

.debug-mode .parallax-element-enhanced {
    outline: 2px dashed rgba(255, 0, 0, 0.5) !important;
    position: relative;
}

.debug-mode .parallax-element-enhanced::after {
    content: attr(data-parallax-type);
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
    z-index: 9999;
    pointer-events: none;
}

/* ============================================
   CUSTOM PROPERTY DEFAULTS
   ============================================ */

:root {
    --parallax-default-duration: 1.5s;
    --parallax-default-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --parallax-default-offset: 50px;
    --parallax-default-start-opacity: 0;
    --parallax-default-end-opacity: 100;
}

/* Apply defaults to elements without custom properties */
.parallax-element-enhanced:not([style*="--animation-speed"]) {
    --animation-speed: var(--parallax-default-duration);
}

.parallax-element-enhanced:not([style*="--start-offset"]) {
    --start-offset: var(--parallax-default-offset);
}

.parallax-element-enhanced:not([style*="--start-opacity"]) {
    --start-opacity: var(--parallax-default-start-opacity);
}

.parallax-element-enhanced:not([style*="--end-opacity"]) {
    --end-opacity: var(--parallax-default-end-opacity);
}

/* ============================================
   ENHANCED PARALLAX UI STYLING
   ============================================ */

/* Enhanced Toggle Switches */
.enhanced-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.enhanced-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Effect Option Cards */
.effect-option {
    position: relative;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s ease;
    background: white;
}

.effect-option:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.effect-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.effect-option input[type="radio"] {
    display: none;
}

.effect-preview {
    text-align: center;
    padding: 4px;
}

.effect-preview i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
    color: #6b7280;
}

.effect-preview span {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.effect-option.selected .effect-preview i {
    color: #3b82f6;
}

.effect-option.selected .effect-preview span {
    color: #1e40af;
}

/* Disabled Controls */
.entrance-controls.disabled,
.continuous-controls.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Control Groups */
.control-group {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.control-group h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* Dual Controls */
.dual-control input[type="range"] {
    background: #e5e7eb;
    outline: none;
    transition: background 0.3s;
}

.dual-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.dual-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
}

.dual-control input[type="number"] {
    font-size: 12px;
    text-align: center;
}

/* Preset Buttons */
.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.preset-btn i {
    font-size: 20px;
    margin-bottom: 4px;
    color: #6b7280;
}

.preset-btn span {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

/* Quick Preset Buttons */
.quick-preset-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-preset-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

/* Tab System Enhancements */
.tab-button {
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3b82f6;
    border-radius: 1px;
}

/* Combined Preview Enhancements */
#combinedAnimationPreview {
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-weight: 600;
}

#combinedAnimationPreview::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;
}

#combinedAnimationPreview:hover::before {
    left: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .effect-option {
        padding: 6px;
    }
    
    .effect-preview i {
        font-size: 16px;
    }
    
    .effect-preview span {
        font-size: 10px;
    }
    
    .dual-control {
        margin-bottom: 12px;
    }
    
    .control-group {
        padding: 12px;
    }
}