/* ============================================
   PT Lossday Sejahtera Group - Animations CSS
   Animasi halus, elegan, dan tidak berlebihan
   ============================================ */

/* Animation Classes */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-up {
    animation: slideUp 0.8s ease forwards;
}

.slide-left {
    animation: slideLeft 0.8s ease forwards;
}

.slide-right {
    animation: slideRight 0.8s ease forwards;
}

.scale-up {
    animation: scaleUp 0.6s ease forwards;
}

/* Stagger Animation Items */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerItem 0.6s ease forwards;
}

/* Delays for stagger effect */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }
.stagger-item:nth-child(10) { animation-delay: 1s; }

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #235abe;
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #235abe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-text {
    text-align: center;
    color: #666;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

.pulse-once {
    animation: pulse 2s ease-in-out;
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

/* Bounce Animation (subtle) */
.bounce-subtle {
    animation: bounceSubtle 2s infinite;
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Scroll Animation Trigger */
.scroll-trigger {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-trigger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card Reveal Animation */
.card-reveal {
    position: relative;
    overflow: hidden;
}

.card-reveal::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.7s ease;
}

.card-reveal:hover::before {
    left: 100%;
}

/* Image Zoom Animation */
.image-zoom-container {
    overflow: hidden;
    border-radius: 8px;
}

.image-zoom {
    transition: transform 0.5s ease;
}

.image-zoom:hover {
    transform: scale(1.1);
}

/* Text Gradient Animation */
.text-gradient {
    background: linear-gradient(45deg, #235abe, #fa961e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Button Hover Effects */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn-hover-effect:hover::before {
    width: 300px;
    height: 300px;
}

/* Marquee Pause on Hover */
.pause-on-hover:hover .marquee-track {
    animation-play-state: paused;
}

/* Modal Entrance */
.modal-entrance {
    animation: modalEntrance 0.4s ease forwards;
}

/* Lightbox Zoom */
.lightbox-zoom {
    animation: lightboxZoom 0.3s ease forwards;
}

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

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

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

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(35, 90, 190, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(35, 90, 190, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(35, 90, 190, 0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

@keyframes lightboxZoom {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Animation Utilities */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.fade-up {
    transform: translateY(30px);
}

.animate-on-scroll.fade-left {
    transform: translateX(-30px);
}

.animate-on-scroll.fade-right {
    transform: translateX(30px);
}

.animate-on-scroll.fade-scale {
    transform: scale(0.9);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Delay Classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }
.delay-1100 { animation-delay: 1.1s; }
.delay-1200 { animation-delay: 1.2s; }

/* Duration Classes */
.duration-200 { animation-duration: 0.2s; }
.duration-300 { animation-duration: 0.3s; }
.duration-400 { animation-duration: 0.4s; }
.duration-500 { animation-duration: 0.5s; }
.duration-600 { animation-duration: 0.6s; }
.duration-700 { animation-duration: 0.7s; }
.duration-800 { animation-duration: 0.8s; }
.duration-900 { animation-duration: 0.9s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* Easing Classes */
.ease-linear { animation-timing-function: linear; }
.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }
.ease-bounce { animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* Animation Fill Modes */
.fill-forwards { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-both { animation-fill-mode: both; }

/* Infinite Animation */
.infinite { animation-iteration-count: infinite; }

/* Pause Animation */
.pause { animation-play-state: paused; }

/* Running Animation */
.running { animation-play-state: running; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 70%;
    margin-bottom: 1em;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    margin-bottom: 1em;
}

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOut 0.5s ease 0.3s forwards;
}

.page-transition-logo {
    width: 100px;
    height: 100px;
    animation: pulse 2s ease infinite;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #235abe;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #235abe; }
}

/* Floating Elements */
.float-slow {
    animation: float 6s ease-in-out infinite;
}

.float-medium {
    animation: float 4s ease-in-out infinite;
}

.float-fast {
    animation: float 2s ease-in-out infinite;
}

/* Attention Seeker */
.attention-pulse {
    animation: pulse 2s infinite;
}

.attention-bounce {
    animation: bounceSubtle 2s infinite;
}

.attention-flash {
    animation: flash 2s infinite;
}

@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.5;
    }
}

/* Custom Cursor Effects */
.custom-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="14" fill="%23235abe" opacity="0.3"/><circle cx="16" cy="16" r="8" fill="%23fa961e"/></svg>') 16 16, pointer;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #235abe, #fa961e);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    border-radius: 12px;
    padding: 3px;
    background: linear-gradient(45deg, #235abe, #fa961e, #235abe);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.gradient-border > div {
    background: white;
    border-radius: 9px;
    padding: 20px;
}

/* Rotating Elements */
.rotate-slow {
    animation: rotate 20s linear infinite;
}

.rotate-medium {
    animation: rotate 10s linear infinite;
}

.rotate-fast {
    animation: rotate 5s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Wave Animation */
.wave {
    animation: wave 2s linear infinite;
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    75% {
        transform: translateY(10px);
    }
}