body {
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 1600px;
    overflow-y: auto;
}

.container {
    max-height: fit-content;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 0; 
    box-sizing: border-box;
    overflow: visible;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: silver;
    border-radius: 12px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 auto 10px;
    max-width: 1600px;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin: 0;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #007BFF;
}

.cardsContainer {
    flex: 1;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    background: linear-gradient(to bottom, #f9f9f9, #eaeaea);
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; 
}

.card {
    position: relative;
    width: 48%;
    height: 560px;
    margin: 10px;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    background-color: white;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.card-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: scale(1.01); 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.681); 
    background-color: rgba(0, 0, 0, 0.5); 
}

.with-background {
    background-color: rgba(120, 118, 118, 0.863);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

@media (min-width: 601px) and (max-width: 1040px) {
    .card {
        width: 46%;
        height: auto;
    }
}

@media (max-width: 600px) {
    body {
        height: 100vh; /* Force full height on mobile */
        overflow: hidden; /* Prevent scrolling if possible */
    }

    .container {
        height: 100%;
        padding: 10px;
        max-height: 100vh;
    }

    .header {
        padding: 10px;
        margin-bottom: 10px;
        flex-shrink: 0; /* Don't shrink header */
    }

    h1 {
        font-size: 1.5em; /* Smaller title */
    }

    .cardsContainer {
        flex-direction: column; /* Stack vertically */
        flex-wrap: nowrap;
        align-items: stretch;
        padding: 5px;
        overflow: hidden;
    }

    .card {
        width: 100%; 
        margin: 5px 0; 
        flex: 1; /* Grow to fill available space */
        height: auto; /* Reset fixed height */
        min-height: 0; /* Allow shrinking */
    }

    .card img {
        height: 100%;
        object-fit: cover;
    }

    .card-text {
        font-size: 1.5em;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 25px;
    }
}


