/**
 * Elementor Scrollytelling Styles
 */

/* Container Styles */
.scrollytelling-container {
    position: relative;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
}

/* Layout Variations */
.scrollytelling-container.layout-sticky-right {
    display: flex;
    flex-direction: row;
}

.scrollytelling-container.layout-sticky-left {
    display: flex;
    flex-direction: row-reverse;
}

.scrollytelling-container.layout-sticky-center .scrollytelling-sticky {
    left: 50%;
    transform: translateX(-50%);
    width: 90% !important;
    max-width: 1200px;
}

.scrollytelling-container.layout-fullscreen .scrollytelling-sticky {
    width: 100% !important;
    height: 100vh;
    left: 0;
}

/* Sticky Content */
.scrollytelling-sticky {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    height: 100vh;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.sticky-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
}

.sticky-content > div {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media Content Styles */
.media-image {
    padding: 2rem;
}

.media-image img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.media-video {
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.media-video iframe,
.media-video video {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.media-chart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.media-chart svg {
    max-width: 100%;
    height: auto;
}

.media-iframe {
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.media-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Steps Container */
.scrollytelling-steps {
    width: 50%;
    position: relative;
    z-index: 2;
}

.layout-sticky-center .scrollytelling-steps,
.layout-fullscreen .scrollytelling-steps {
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Individual Steps */
.scrollytelling-step {
    min-height: 80vh;
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    position: relative;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.scrollytelling-step.is-active {
    opacity: 1;
}

.scrollytelling-step:first-child {
    padding-top: 20vh;
}

.scrollytelling-step:last-child {
    padding-bottom: 40vh;
}

/* Step Content */
.step-content {
    max-width: 600px;
    margin: 0 auto;
}

.layout-sticky-center .step-content,
.layout-fullscreen .step-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.step-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.3;
}

.step-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #666;
}

.step-text p {
    margin-bottom: 1.25rem;
}

.step-text p:last-child {
    margin-bottom: 0;
}

/* Progress Bar */
.scrollytelling-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4A90E2, #7B68EE);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Navigation Dots */
.scrollytelling-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #333;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot:hover {
    background: rgba(51, 51, 51, 0.3);
    transform: scale(1.2);
}

.nav-dot.active {
    background: #333;
    transform: scale(1.3);
}

.nav-dot::before {
    content: attr(aria-label);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.nav-dot:hover::before {
    opacity: 1;
}

/* Transition Animations */
.transition-fade .sticky-content > div {
    transition: opacity 0.6s ease;
}

.transition-slide .sticky-content > div {
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.transition-zoom .sticky-content > div {
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.transition-morph .sticky-content > div {
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Parallax Effect */
.transition-parallax .scrollytelling-step {
    will-change: transform, opacity;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .scrollytelling-container.layout-sticky-right,
    .scrollytelling-container.layout-sticky-left {
        flex-direction: column;
    }
    
    .scrollytelling-sticky {
        width: 100% !important;
        height: 50vh;
        position: sticky;
        top: 0;
    }
    
    .scrollytelling-steps {
        width: 100%;
    }
    
    .scrollytelling-step {
        min-height: 60vh;
        padding: 3rem 2rem;
    }
    
    .step-content {
        background: rgba(255, 255, 255, 0.95);
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .scrollytelling-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .scrollytelling-sticky {
        height: 40vh;
    }
    
    .scrollytelling-step {
        min-height: 50vh;
        padding: 2rem 1.5rem;
    }
    
    .step-title {
        font-size: 1.5rem;
    }
    
    .step-text {
        font-size: 1rem;
    }
    
    .media-image img,
    .media-video iframe,
    .media-video video,
    .media-iframe iframe {
        max-height: 35vh;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .scrollytelling-container {
        background: #1a1a1a;
    }
    
    .step-content {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .step-title {
        color: #f0f0f0;
    }
    
    .step-text {
        color: #b0b0b0;
    }
    
    .nav-dot {
        border-color: #f0f0f0;
    }
    
    .nav-dot.active {
        background: #f0f0f0;
    }
    
    .scrollytelling-progress {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Elementor Editor Styles */
.elementor-editor-active .scrollytelling-container {
    min-height: 500px;
}

.elementor-editor-active .scrollytelling-sticky {
    position: relative;
    height: 400px;
}

.elementor-editor-active .scrollytelling-step {
    opacity: 1;
    min-height: auto;
    padding: 2rem;
    border: 1px dashed #ccc;
    margin-bottom: 1rem;
}

/* Loading States */
.scrollytelling-container.is-loading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scrollytelling-container.is-loaded {
    opacity: 1;
}

/* Smooth Scroll Enhancement */
html.has-smooth-scroll {
    overflow: hidden;
}

html.has-smooth-scroll body {
    overflow: hidden;
}

/* Print Styles */
@media print {
    .scrollytelling-sticky {
        position: relative;
        height: auto;
    }
    
    .scrollytelling-step {
        opacity: 1;
        page-break-inside: avoid;
    }
    
    .scrollytelling-progress,
    .scrollytelling-nav {
        display: none;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide {
    animation: slideIn 0.6s ease forwards;
}

.animate-zoom {
    animation: zoomIn 0.6s ease forwards;
}