/* Animation Keyframes for Various Elements */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes floatX {
    0% {
        transform: translateX(0px);
    }

    50% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0px);
    }
}

@keyframes sparkle {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced Animation Keyframes */
@keyframes floatUpDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes rotateSlowly {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes blinkStar {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.7);
    }
}

@keyframes waveMotion {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(10px) translateY(-5px);
    }

    50% {
        transform: translateX(0) translateY(-10px);
    }

    75% {
        transform: translateX(-10px) translateY(-5px);
    }
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #3b82f6
    }
}

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

@keyframes imageReveal {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoom-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

@keyframes zoom-in {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-5px);
        opacity: 0.95;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

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

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

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

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float-x {
    animation: floatX 5s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 15s linear infinite;
}

.animate-sparkle {
    animation: sparkle 3s ease-in-out infinite;
}

.animate-gradient {
    background: linear-gradient(270deg, #3b82f6, #1e40af, #2563eb);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.carousel-slide.zoom-out {
    animation: zoom-out 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.carousel-slide.zoom-in {
    animation: zoom-in 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.carousel-slide.fade-out {
    opacity: 0;
    transform: scale(0.95) translateY(-15px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.carousel-slide.fade-in {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

/* Animation Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

.delay-900 {
    animation-delay: 900ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* Section-based fade animations */
section {
    overflow: hidden;
}

section>div,
section>h2,
section>p,
section>a,
.service-card,
.article-card,
.sponsor-card,
.gallery-item,
.team-member {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.shattered-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

.shattered-piece {
    overflow: hidden;
    transform-origin: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.shattered-transition.active .shattered-piece {
    opacity: 0;
    transform: scale(0) rotate(var(--rotate-deg));
}

/* Enhanced Component Animations */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.image-hover {
    transition: all 0.5s ease;
    overflow: hidden;
}

.image-hover img {
    transition: all 0.5s ease;
}

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

.button-hover {
    transition: all 0.3s ease;
}

.button-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Animate elements on scroll (to be used with JS) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced navigation animations */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, white, transparent);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

.nav-link:hover {
    color: #dbeafe !important;
    text-shadow: 0 0 8px rgba(219, 234, 254, 0.5);
    transform: translateY(-2px);
}

.scrolled-nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    font-size: 0.875rem !important;
}

.scrolled-nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1e40af, transparent);
    transition: width 0.3s ease, left 0.3s ease, background 0.3s ease;
}

.scrolled-nav-link:hover {
    color: #1e3a8a !important;
    transform: translateY(-1px);
    text-shadow: none;
}

.scrolled-nav-link:hover::after,
.scrolled-nav-link.active::after {
    width: 100%;
    left: 0;
    background: linear-gradient(90deg, transparent, #1e3a8a, transparent);
}

/* Enhanced Header transition styles */
header {
    transition: all 0.4s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

header.scrolled {
    animation: slideInDown 0.4s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

header.scrolled .py-8,
header.scrolled .py-4 {
    transition: padding 0.4s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

header.scrolled .h-20,
header.scrolled .h-12 {
    transition: height 0.4s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

header.scrolled:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}