/* ===== PREVENT HORIZONTAL SCROLL ===== */

/* Prevent horizontal overflow on all devices */
html, body {
    overflow-x: hidden;
}

/* ===== ANIMATION UTILITIES ===== */


/* Base fade animations */
.fade-in-delayed {
    opacity: 0;
    animation: fadeIn 1s ease-in-out 3s forwards;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
    animation: fadeInDown 0.8s ease-out forwards;
}

/* Combined fade-in and elastic pulse */
.fade-in-delayed-elastic {
    opacity: 0;
    animation: fadeIn 1s ease-in-out 3s forwards, elasticPulse 3s ease-out 6s infinite;
}

/* Combined fade-in and rotation */
.fade-in-delayed-rotate {
    opacity: 0;
    animation: fadeIn 1s ease-in-out 3s forwards, rotateSteps 6s linear 4s infinite; /* 6s = total cycle time (includes pauses) */
}

/* Combined fade-in and reverse rotation */
.fade-in-delayed-rotate-reverse {
    opacity: 0;
    animation: fadeIn 1s ease-in-out 3s forwards, rotateStepsReverse 7s linear 5s infinite; /* 7s cycle, 5s delay for offset timing */
}

/* Scroll-triggered animations (add these classes via JavaScript on scroll) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Pop-in elastic animation for scroll system */
.pop-in-on-scroll {
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pop-in-on-scroll.in-view {
    opacity: 1;
    transform: scale(1);
}

.slide-text-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 1s ease-out;
}

.slide-text-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.slide-text-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 1s ease-out;
}

.slide-text-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

/* Delay variations */
.delay-3000 { animation-delay: 3s; }

/* ===== KEYFRAME DEFINITIONS ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes elasticPulse {
    0%, 85% {
        transform: scale(1);
    }
    90% {
        transform: scale(1.3);
    }
    95% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotateSteps {
    0%, 40% {
        transform: rotate(0deg);
    }
    45% { /* Change 45% to adjust rotation speed - lower % = faster rotation */
        transform: rotate(95deg);
    }
    50%, 90% {
        transform: rotate(90deg);
    }
    95% { /* Change 95% to adjust return speed - higher % = faster return */
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes rotateStepsReverse {
    0%, 35% {
        transform: rotate(0deg);
    }
    40% {
        transform: rotate(-95deg);
    }
    45%, 85% {
        transform: rotate(-90deg);
    }
    90% {
        transform: rotate(5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}


/* ===== INFINITE TICKER ANIMATION ===== */

/* Infinite horizontal ticker animation with direction options */
.ticker-scroll-rtl {
    animation: tickerScrollRTL 40s linear infinite;
}

/* Right to left animation (content moves from right to left) */
@keyframes tickerScrollRTL {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ===== INTERVIEW CARD ARROW ANIMATION ===== */

/* Arrow shoot animation - exits top-right, enters from bottom-left */
@keyframes arrowShoot {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: translate(20px, -20px);
        opacity: 0;
    }
    51% {
        transform: translate(-20px, 20px);
        opacity: 0;
    }
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* Hover state for interview cards */
.interview-card:hover .arrow-icon {
    animation: arrowShoot 0.6s ease-in-out forwards;
}

/* Prevent reverse animation on mouseout */
.interview-card .arrow-icon {
    animation-fill-mode: forwards;
}

/* Color transitions on hover */
.interview-card .link-text {
    transition: color 0.3s ease;
}

.interview-card:hover .link-text {
    color: #3C9BE4;
}

.interview-card .arrow-container {
    transition: background-color 0.3s ease;
}

.interview-card:hover .arrow-container {
    background-color: #3C9BE4;
}

/* Image zoom effect on hover */
.interview-card .thumbnail-image {
    transition: transform 0.3s ease;
}

.interview-card:hover .thumbnail-image {
    transform: scale(1.05);
}

/* ===== DATA SECTION BACKGROUND ===== */

/* Mobile background image for data section */
@media (max-width: 767px) {
    section.data {
        background-image: url('../assets/images/data-bg-mobile.svg') !important;
    }
}

/* ===== FOOTER MOBILE RESPONSIVE ===== */

/* Mobile background image for footer */
@media (max-width: 767px) {
    footer {
        background-image: url('../assets/images/footer-bg-mobile.svg') !important;
    }
}

/* ===== INTERVIEWS SECTION MOBILE RESPONSIVE ===== */

/* Mobile background image for interviews section */
@media (max-width: 767px) {
    section.interviews {
        background-image: url('../assets/images/interview-bg-line-mobile.png'), url('../assets/images/interview-bg.jpg') !important;
        background-size: 768px 300px, cover !important;
        background-position: top center, top center !important;
        background-repeat: no-repeat, no-repeat !important;
    }
}

/* ===== FOOTER BUTTON ANIMATIONS ===== */

/* Footer button hover effects */
.footer-button:hover .arrow-icon {
    animation: arrowShoot 0.6s ease-in-out forwards;
}

/* Prevent reverse animation on mouseout */
.footer-button .arrow-icon {
    animation-fill-mode: forwards;
}

/* Footer button arrow icon stroke color */
.footer-button .arrow-icon path {
    stroke: white;
}

.footer-button.group:hover .arrow-icon path {
    stroke: #05419A;
}

/* ===== SVG ANIMATION CONTROL ===== */

/* Pause all SVG animations by default */
.svg-animation-paused * {
    animation-play-state: paused !important;
}

/* Play SVG animations when triggered */
.svg-animation-playing * {
    animation-play-state: running !important;
}

/* Scroll-triggered SVG animation wrapper */
.svg-animate-on-scroll {
    opacity: 1;
}

.svg-animate-on-scroll.paused * {
    animation-play-state: paused !important;
}

.svg-animate-on-scroll.playing * {
    animation-play-state: running !important;
}

.svg-animate-on-scroll.animate-on-scroll {
    transform: none;
}
