/* Flexbox container */
.download-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Consistent box sizing for 3 items per row */
.download-item {
    flex-basis: 30%; /* 3 items per row */
    margin-bottom: 20px; /* Space between boxes */
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
    min-height: 350px; /* Ensure all boxes are tall enough to accommodate content */
    position: relative; /* Positioning context for absolute elements */
    transition: transform 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease;
    will-change: transform, background-color;
    overflow: hidden; /* Prevent overflow when scaling the images */
    border: 1px solid rgb(4, 3, 3); /* Black border */
    text-shadow: 4px 4px 8px rgb(252, 182, 4); /* Add subtle white shadow */
    
}

/* Image styling */ 
.download-item img {
    width: 100%; /* Set width to 100% to fill the container */
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border-radius: 8px;
    border: 1px solid rgb(252, 182, 4); /* Black border */
    transition: transform 0.5s ease, opacity 0.5s ease; /* Smoother and slower transformation */
    will-change: transform, opacity;
    border: 1px solid rgb(252, 182, 4); /* Black border */
    box-shadow: 0 0 20px rgba(241, 190, 4, 0.6); /* Soft red shadow for emphasis */
    
}

/* Game name (h3) styling */
.download-item h3 {
    margin: 15px 0;
    font-size: 18px;
    transition: color 0.3s ease; /* Transition for hover effect */
}

/* Hover effect on game name */
.download-item:hover h3 {
    color: white; /* Change name color to white on hover */
}

/* Subtle hover effect on the box */
.download-item:hover, .download-item:active {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    background-color: #0e0c0c;
    border-radius: 12px; /* Increased from 8px to 12px */
}

/* Update the base class to match */
.download-item {
    border-radius: 12px; /* Added here for consistency */
    /* Rest of your existing properties... */
}

/* Image hover effect */
.download-item:hover img {
    transform: scale(1.1); /* Subtle zoom-in effect on hover */
    opacity: 0.9; /* Slight fade for a softer look */
}

/* Button container */
.button-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    text-align: center;
    z-index: 1;
    box-shadow: 0 0 20px rgba(241, 190, 4, 0.6); /* Soft red shadow for emphasis */
}

.button-container .btn {
    display: inline-block;
    padding: 8px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 8px;
    transition: background 0.3s, transform 0.3s, border-color 0.3s;
    border: 1px solid rgb(252, 182, 4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
}

/* Button hover effect */
.button-container .btn:hover,
.button-container .btn:active,
.button-container .btn:focus {
    background: #28a745;
    transform: scale(1.08);
    border-color: rgb(252, 182, 4);
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .download-list {
        justify-content: center; /* Better centering on mobile */
    }
    
    .download-item {
        flex-basis: 46%; /* 2 items per row on tablets with better spacing */
        min-height: 320px;
        margin: 0 2% 20px 2%; /* More consistent margins */
    }

    .download-item h3 {
        font-size: 16px;
        margin: 12px 0 15px 0;
    }

    .download-item img {
        height: 180px; /* Slightly smaller images on tablets */
    }

    .button-container {
        position: relative;
        margin-top: 15px;
        width: auto;
    }
    .button-container .btn {
        border: 1px solid rgb(252, 182, 4);
    }
    .button-container .btn:hover,
    .button-container .btn:active,
    .button-container .btn:focus {
        border-color: rgb(252, 182, 4);
    }
}

@media (max-width: 480px) {
    .download-item {
        flex-basis: 100%; /* Full width on mobile */
        min-height: 280px;
        border-radius: 12px;
        margin: 0 0 20px 0; /* Full width margins */
        padding: 15px;
    }
    
    .download-item img {
        height: 160px; /* Optimize image height for mobile */
    }

    /* Simulate hover effect for mobile */
    .download-item:active img, .download-item:focus img {
        transform: scale(1.05); /* Less aggressive zoom for mobile */
        opacity: 0.95; /* Slight fade */
    }
    
    /* More space between stacked items */
    .download-list {
        gap: 15px;
    }

    .download-item h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .button-container {
        margin-top: 15px;
        padding: 0 10px;
    }
}

/* Scroll animation for images */
.scroll-animate {
    transform: scale(1.1);
    opacity: 1;
    transition: transform 0.5s ease, opacity 0.5s ease;
}
