/* ==========================================================================
   Animations & Effects
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Basic Keyframes
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideLeft {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* --------------------------------------------------------------------------
   2. Utility Classes
   -------------------------------------------------------------------------- */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideRight 0.8s ease-out forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.8s ease-out forwards;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* --------------------------------------------------------------------------
   3. Hover Effects
   -------------------------------------------------------------------------- */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(0, 31, 63, 0.5);
}

/* --------------------------------------------------------------------------
   4. Background Animations
   -------------------------------------------------------------------------- */
.bg-gradient-animate {
    background: linear-gradient(270deg, #001f3f, #2ecc71, #e67e22, #f1c40f);
    background-size: 800% 800%;
    animation: gradientAnimation 15s ease infinite;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --------------------------------------------------------------------------
   5. Loading Bar
   -------------------------------------------------------------------------- */
.loading-bar-container {
    width: 100%;
    height: 4px;
    background-color: #eee;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    animation: loadingBar 2s ease-in-out infinite;
}

@keyframes loadingBar {
    0% {
        width: 0;
        transform: translateX(-100%);
    }

    50% {
        width: 50%;
        transform: translateX(0);
    }

    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* --------------------------------------------------------------------------
   6. Neon Glow
   -------------------------------------------------------------------------- */
.neon-glow {
    color: #fff;
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #001f3f,
        0 0 30px #001f3f,
        0 0 40px #001f3f,
        0 0 50px #001f3f,
        0 0 75px #001f3f;
}

/* --------------------------------------------------------------------------
   7. Card Flip
   -------------------------------------------------------------------------- */
.flip-card {
    background-color: transparent;
    width: 300px;
    height: 200px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.flip-card-front {
    background-color: #fff;
    color: black;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.flip-card-back {
    background-color: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   8. Wave Animation
   -------------------------------------------------------------------------- */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}

.wave .shape-fill {
    fill: #FFFFFF;
}

/* --------------------------------------------------------------------------
   9. Typewriter Effect
   -------------------------------------------------------------------------- */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: .15em solid orange;
    animation:
        typing 3.5s steps(40, end),
        blink-caret .75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: orange;
    }
}

/* --------------------------------------------------------------------------
   10. Glitch Effect
   -------------------------------------------------------------------------- */
.glitch {
    position: relative;
    color: white;
    font-size: 2em;
    font-weight: bold;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    10% {
        clip: rect(15px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(95px, 9999px, 5px, 0);
    }

    30% {
        clip: rect(5px, 9999px, 60px, 0);
    }

    40% {
        clip: rect(65px, 9999px, 20px, 0);
    }

    50% {
        clip: rect(45px, 9999px, 40px, 0);
    }

    60% {
        clip: rect(85px, 9999px, 15px, 0);
    }

    70% {
        clip: rect(25px, 9999px, 70px, 0);
    }

    80% {
        clip: rect(10px, 9999px, 90px, 0);
    }

    90% {
        clip: rect(55px, 9999px, 35px, 0);
    }

    100% {
        clip: rect(75px, 9999px, 50px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 80px, 0);
    }

    10% {
        clip: rect(25px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(5px, 9999px, 40px, 0);
    }

    30% {
        clip: rect(95px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(15px, 9999px, 70px, 0);
    }

    50% {
        clip: rect(85px, 9999px, 30px, 0);
    }

    60% {
        clip: rect(55px, 9999px, 50px, 0);
    }

    70% {
        clip: rect(35px, 9999px, 15px, 0);
    }

    80% {
        clip: rect(75px, 9999px, 60px, 0);
    }

    90% {
        clip: rect(45px, 9999px, 95px, 0);
    }

    100% {
        clip: rect(10px, 9999px, 5px, 0);
    }
}

/* --------------------------------------------------------------------------
   11. Staggered Animation
   -------------------------------------------------------------------------- */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   12. Ripple Effect
   -------------------------------------------------------------------------- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   13. Floating Elements (variations)
   -------------------------------------------------------------------------- */
.float-fast {
    animation: float 10s infinite linear;
}

.float-medium {
    animation: float 15s infinite linear;
}

.float-slow {
    animation: float 20s infinite linear;
}

.float-reverse {
    animation: float-reverse 15s infinite linear;
}

@keyframes float-reverse {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(-360deg);
        opacity: 0;
    }
}