.dynamic-header {
    width: 100%;
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    background-color: #e74c3c;
}

.header-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.header-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(1px); /* Adjust this value to slightly blur the image if it appears pixelated */
    transition: background-image 0.5s ease-in-out;
    animation: backgroundZoom 10s ease-in-out infinite alternate;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-content h1 {
    font-size: 5vw;
    color: #fff;
    margin: 0;
    animation: fadeInDown 1.5s ease forwards; /* Ensures smoother appearance */
}

.header-content h2 {
    font-size: 1.2vw;
    color: #ffe4e1;
    margin-top: 10px;
    animation: fadeInUp 1.5s ease forwards;
}

.header-button {
    display: inline-block;
    padding: 15px 30px;
    margin-top: 30px;
    font-size: 1.2vw;
    color: #fff;
    background-color: #ff6347;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.header-button:hover {
    background-color: #e5533d;
    transform: scale(1.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textZoom {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes backgroundZoom {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .dynamic-header {
        height: 80vh;
    }

    .header-content h1 {
        font-size: 8vw;
    }

    .header-content h2 {
        font-size: 2.5vw;
    }

    .header-button {
        font-size: 2.5vw;
        padding: 12px 25px;
    }
}

@media (max-width: 768px) {
    .dynamic-header {
        height: 70vh;
    }

    .header-content h1 {
        font-size: 7vw;
    }

    .header-content h2 {
        font-size: 2.2vw;
    }

    .header-button {
        font-size: 3vw;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .dynamic-header {
        height: 50vh;
    }

    .header-content h1 {
        font-size: 12vw;
    }

    .header-content h2 {
        font-size: 4vw;
    }

    .header-button {
        font-size: 4vw;
        padding: 8px 15px;
    }
}
