/* Container styling */
.e404-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    font-family: Arial, sans-serif;
    overflow: hidden;
    color: #fff;
}

/* Animated gradient background */
.e404-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, #ee1d24, #242176, #242176, #ee1d24);
    background-size: 400% 400%;
    animation: e404-bg-animation 15s ease infinite;
    z-index: -2;
}

@keyframes e404-bg-animation {
    0% {
        background-position: 0% 50%;
    }

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

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

/* Floating particles */
.e404-particle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    opacity: 0.6;
    z-index: -1;
}

/* Each particle unique size, position, speed */
.e404-p1 {
    width: 8px;
    height: 8px;
    top: 10%;
    left: 5%;
    animation: e404-p-move 25s linear infinite;
}

.e404-p2 {
    width: 12px;
    height: 12px;
    top: 20%;
    left: 20%;
    animation: e404-p-move 30s linear infinite;
}

.e404-p3 {
    width: 6px;
    height: 6px;
    top: 50%;
    left: 10%;
    animation: e404-p-move 22s linear infinite;
}

.e404-p4 {
    width: 10px;
    height: 10px;
    top: 70%;
    left: 30%;
    animation: e404-p-move 28s linear infinite;
}

.e404-p5 {
    width: 15px;
    height: 15px;
    top: 30%;
    left: 60%;
    animation: e404-p-move 35s linear infinite;
}

.e404-p6 {
    width: 7px;
    height: 7px;
    top: 40%;
    left: 80%;
    animation: e404-p-move 27s linear infinite;
}

.e404-p7 {
    width: 9px;
    height: 9px;
    top: 60%;
    left: 50%;
    animation: e404-p-move 32s linear infinite;
}

.e404-p8 {
    width: 5px;
    height: 5px;
    top: 15%;
    left: 75%;
    animation: e404-p-move 20s linear infinite;
}

.e404-p9 {
    width: 11px;
    height: 11px;
    top: 80%;
    left: 15%;
    animation: e404-p-move 30s linear infinite;
}

.e404-p10 {
    width: 8px;
    height: 8px;
    top: 25%;
    left: 40%;
    animation: e404-p-move 26s linear infinite;
}

.e404-p11 {
    width: 6px;
    height: 6px;
    top: 55%;
    left: 65%;
    animation: e404-p-move 28s linear infinite;
}

.e404-p12 {
    width: 10px;
    height: 10px;
    top: 35%;
    left: 85%;
    animation: e404-p-move 34s linear infinite;
}

.e404-p13 {
    width: 7px;
    height: 7px;
    top: 45%;
    left: 5%;
    animation: e404-p-move 24s linear infinite;
}

.e404-p14 {
    width: 12px;
    height: 12px;
    top: 65%;
    left: 25%;
    animation: e404-p-move 33s linear infinite;
}

.e404-p15 {
    width: 9px;
    height: 9px;
    top: 75%;
    left: 70%;
    animation: e404-p-move 29s linear infinite;
}

/* Particle animation */
@keyframes e404-p-move {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }

    50% {
        transform: translateY(-50px) translateX(30px) rotate(180deg);
    }

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

/* 404 number floating and fade-in */
.e404-title {
    font-size: 10rem;
    font-weight: bold;
    margin: 0;
    animation: e404-float 3s ease-in-out infinite, e404-fade-in 1s ease forwards;
}

@keyframes e404-float {

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

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

/* Subtitle */
.e404-subtitle {
    font-size: 2rem;
    margin: 10px 0 20px 0;
    animation: e404-slide-up 1s ease forwards 0.5s;
}

/* Paragraph */
.e404-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
    animation: e404-slide-up 1s ease forwards 1s;
}

/* Button */
.e404-btn-home {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    border: 2px solid #fff;
    transition: all 0.3s ease;
    animation: e404-fade-in 1s ease forwards 1.5s;
}

.e404-btn-home:hover {
    background-color: #fff;
    color: #e74c3c;
    transform: scale(1.05);
}

/* Animations */
@keyframes e404-fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes e404-slide-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Responsive adjustments */
@media (max-width: 600px) {
    .e404-title {
        font-size: 6rem;
    }

    .e404-subtitle {
        font-size: 1.5rem;
    }

    .e404-text {
        font-size: 1rem;
    }
}