/* Improved Style for the upcoming events section */
.upcoming-events-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    border-radius: 15px;
    border: 1px solid #444; /* Subtle border */
    box-shadow: 0 0 20px #3498db; /* Outer Glow */
}

.upcoming-events-container h3 {
    font-size: 2.4em;
    margin-bottom: 25px;
    color: #3498db; /* Blue Color for the heading */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); /* Text shadow for emphasis */
    letter-spacing: 1px; /* Slight letter spacing */
    text-transform: uppercase;
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}

.upcoming-events-container h3:after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    height: 5px;
    width: 50px;
    background-color: #3498db; /* Blue underline */
}

.event-wrapper {
    display: inline-block;
    margin: 20px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    width: 500px; /* Increased width for more image width */
    height: 530px; /* Adjust the height of the event boxes */
    background-color: rgba(127, 140, 141, 0.3); /* Grey background */
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
    border: 2px solid rgba(127, 140, 141, 0.3); /* No border */
    box-shadow: none; /* Removed box shadow on the event wrapper */
    text-decoration: none;
    color: inherit;
}

.event-wrapper:hover {
    transform: translateY(-5px);
}

.event {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.4), 0 0 15px #90ee90;
    border: 2px solid #555;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */ /* REMOVE THIS LINE! */
}

.event img {
    width: 100%;
    height: 55%; /* Reduced image height */
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

.event h4 {
    margin-top: 5px; /* Adjusted margin */
    font-size: 1.1em; /* Slightly reduced font size */
    color: #eee;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    padding: 5px;
    /* flex-grow: 1;  REMOVED THIS LINE */
    margin-bottom: 1em;
}

.event p {
    margin-top: 3px;
    font-size: 0.9em; /* Reduced font size */
    color: #eee;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    padding: 3px;
}

.register-button {
    display: block;
    padding: 8px 16px; /* Reduced padding */
    background-color: #f0f0f0; /* Orange color for button */
    color: #FFFFFF;
    font-size: 0.9em; /* Reduced font size */
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
    margin-top: 8px; /* Adjusted margin */
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.register-button:hover {
    background-color: #ff0000; /* Darker orange on hover */
    transform: scale(1.05);
}

.view-all-events-button {
    display: block;
    padding: 12px 30px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 1.2em;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.view-all-events-button:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .event-wrapper {
        width: 90%;
        height: auto;
        margin: 15px auto;
        display: block;
    }

    .event {
        height: auto;
    }

    .event img {
        height: auto;
    }
}