/* Animation Styles for Digital Signage */

/* Slide Entrance Animations */
.slide {
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.slide-in-right {
    animation-name: slideInRight;
}

.slide.slide-in-left {
    animation-name: slideInLeft;
}

.slide.slide-in-up {
    animation-name: slideInUp;
}

.slide.slide-in-down {
    animation-name: slideInDown;
}

.slide.fade-in {
    animation-name: fadeIn;
}

.slide.zoom-in {
    animation-name: zoomIn;
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

/* Exit Animations */
.slide.slide-out-left {
    animation-name: slideOutLeft;
}

.slide.slide-out-right {
    animation-name: slideOutRight;
}

.slide.fade-out {
    animation-name: fadeOut;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

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

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

/* Content Animations */
.title-animation {
    animation: titleEntry 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@keyframes titleEntry {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.subtitle-animation {
    animation: subtitleEntry 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

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

/* Stagger Animations for Lists */
.announcement-item,
.event-card,
.weather-card {
    animation: staggerFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.announcement-item:nth-child(1),
.event-card:nth-child(1),
.weather-card:nth-child(1) {
    animation-delay: 0.1s;
}

.announcement-item:nth-child(2),
.event-card:nth-child(2),
.weather-card:nth-child(2) {
    animation-delay: 0.2s;
}

.announcement-item:nth-child(3),
.event-card:nth-child(3),
.weather-card:nth-child(3) {
    animation-delay: 0.3s;
}

.announcement-item:nth-child(4),
.event-card:nth-child(4),
.weather-card:nth-child(4) {
    animation-delay: 0.4s;
}

.announcement-item:nth-child(5),
.event-card:nth-child(5),
.weather-card:nth-child(5) {
    animation-delay: 0.5s;
}

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

/* Background Animations */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.slide {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Pulse Animation for Important Elements */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Glow Effect */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Rotate Animation */
.rotate {
    animation: rotate 20s linear infinite;
}

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

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid rgba(255, 255, 255, 0.75);
    animation: typewriter 3s steps(40) 1s both, blink 0.75s step-end infinite;
}

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

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Text reveal with mask */
.text-reveal {
    background: linear-gradient(90deg, transparent 0%, white 50%, transparent 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textReveal 2s ease-out forwards;
}

@keyframes textReveal {
    0% {
        background-position: -200% 0;
        opacity: 0;
    }
    100% {
        background-position: 200% 0;
        opacity: 1;
    }
}

/* Scale Hover Effect */
.scale-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Slide Up on Scroll */
.slide-up {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* Fade and Scale */
.fade-scale {
    animation: fadeScale 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* Particle Effect Background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 10s infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}
