/* You can add these font imports to your HTML head section for a more cohesive look */
/* <link rel="preconnect" href="https://fonts.googleapis.com"> */
/* <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> */
/* <link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;700&display=swap" rel="stylesheet"> */

/* Final CSS with bigger thumbnails and logos */

/* Universal box-sizing rule to prevent padding from causing overflow */
* {
  box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden; /* Prevents horizontal scrolling */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* This pushes the footer down to the bottom */
}

/* Header & Logo Section */
.main-header {
    width: 100%;
    position: relative;
    padding-bottom: 0;
    margin-bottom: 20px;
    background-color: white;
    border-bottom: 1px solid #ccc;
    height: 115px; /* Increased height to accommodate the bigger logos */
}

.gradient-span {
    height: 100%; 
    width: 100%;
    background: linear-gradient(90deg,  #54018f, #aa7116);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 10px; 
    gap: 10px;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 2;
    width: 100%; /* Ensure content stays within the header width */
}

.logo {
    height: 85px; /* Increased logo height */
    width: auto;
}

.company-title-png {
    height: 85px; /* Increased company name image height */
    width: auto;
}

h1 {
    text-align: center;
    padding: 10px;
}

/* Style for the sub-header */
.sub-header {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    margin-top: -10px; /* Pull it up closer to the header */
    margin-bottom: 20px;
}

/* Game List Section */
.game-list {
    list-style: none;
    padding: 0 10px; 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); /* Min-width increased for larger thumbnails */
    gap: 25px; /* Increased gap */
    max-width: 1200px;
    margin: 0 auto;
}

.game-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* Advanced: Added transition duration */
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-item:hover {
    transform: translateY(-8px); /* Advanced: A slightly more dramatic lift */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25); /* Advanced: A bigger, more noticeable shadow */
}


.game-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-item img {
    width: 100%;
    display: block;
    height: 270px; /* Increased thumbnail height */
    object-fit: cover;
    transition: transform 0.3s ease-in-out; /* Advanced: Add a transition for the zoom effect */
}

.game-item:hover img {
    transform: scale(1.1); /* Advanced: Zooms the image to 110% of its size */
}

.game-info {
    position: relative;
    padding: 12px; /* Increased padding */
    background-color: #fff;
}

.game-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.game-title {
    font-family: 'Poppins', sans-serif; /* Changed font to Poppins for readability */
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.3em; /* Adjusted font size for larger thumbnails */
    text-align: center;
    color: #333; /* Changed to a dark color for readability */
    position: relative;
    z-index: 2;
}

/* Styles for prices and discounts */
.game-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #333; /* Changed for contrast */
    position: relative;
    z-index: 2;
}

.original-price {
    font-size: 1.1em; /* Increased font size for better visibility */
    color: #ccc; /* Made it a brighter, lighter gray */
    text-decoration: line-through;
    font-weight: bold; /* Made bold to stand out more */
}

.discounted-price {
    font-size: 1.8em; /* Adjusted font size */
    color: #ffbb4e; /* Changed to a brighter color from the header gradient */
    font-weight: bold;
}

.discount-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #e53935; /* Changed to red */
    color: white;
    padding: 7px 12px; /* Adjusted padding */
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em; /* Adjusted font size */
    z-index: 10;
}

/* CTA Button Styles */
.cta-button {
    background: linear-gradient(135deg, #aa7116 0%, #54018f 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Preview Page Styling --- */

/* Shared styles for both preview pages */
.game-container iframe {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.game-details {
    padding: 10px; /* Reduced padding for a shorter height */
    background-color: #fff;
    color: #333;
    border-radius: 10px;
    height: 600px;
}

/* Styles specific to the desktop preview page */
.game-preview-desktop {
    display: flex;
    flex-direction: row; /* Set to row to have text on the left */
    gap: 60px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.game-preview-desktop .game-container {
    flex-grow: 1; /* Game container will fill remaining space */
    width: auto;
}

.game-preview-desktop .game-details {
    width: 500px; /* Reduced width for a shorter details block */
    padding: 40px;
}

.game-preview-desktop .game-container iframe {
    height: 600px;
}

/* Styles specific to the mobile preview page */
.game-preview-mobile {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.game-preview-mobile .game-container iframe {
    height: 400px;
}

/* New CSS for the stylish back button */
.back-button {
    background: linear-gradient(135deg, #54018f 0%, #ffaa22 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin-bottom: 20px; /* Add some space below the button */
    margin-left: 20px;
}

.contact-button {
    background: linear-gradient(135deg, #54018f 0%, #ffaa22 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin-bottom: 20px; /* Add some space below the button */
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Styles for the fullscreen mobile preview page */
.mobile-game-fullscreen {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.mobile-game-fullscreen .game-container,
.mobile-game-fullscreen .game-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Styles for the buttons on top of the game */
.top-buttons {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 20; /* Ensure buttons are on top of the iframe */
}

/* Styles for the details overlay */
.game-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black background */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 30; /* Higher z-index to be on top of everything else */
    visibility: hidden; /* Start hidden */
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
    box-sizing: border-box; /* To ensure padding doesn't affect layout */
}

.game-details-content {
    background-color: white;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto; /* Enable scrolling if content is long */
}

/* New rule for the mobile iframe with straight corners */
.mobile-game-iframe {
    border-radius: 0;
    border: none;
}

.bottom-buttons {
    position: absolute;
    bottom: 50px;
    right: 10px;
    z-index: 20; /* Ensure it's on top of the iframe */
}

.button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Allows clicks to pass through to the iframe */
}

.button-overlay .top-buttons,
.button-overlay .bottom-buttons {
    pointer-events: auto; /* Re-enable pointer events for the buttons themselves */
}

.button-overlay .top-buttons {
    position: absolute;
    top: 10px;
    left: 10px;
}

.button-overlay .bottom-buttons {
    position: absolute;
    bottom: 10px;
    right: 10px;
}
/* New rule for the touch-capture overlay */
.touch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Higher than iframe, lower than buttons */
    pointer-events: auto; /* To capture touches */
    cursor: pointer;
}

.details-button,
.close-details-button {
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #54018f, #ffaa22);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.details-button:hover,
.close-details-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}


/* --- Footer Styling --- */
.main-footer {
    width: 100%;
    background: #54018f;
    color: #fff;
    padding: 10px; /* Changed padding to make it shorter */
    margin-top: 20px;
    font-size: 0.8em;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .main-footer {
        flex-direction: column;
    }
}

.main-footer p {
    margin: 0; /* Remove default paragraph margin */
}

.main-footer a {
    color: #fff; /* Changed link color to be readable on the gradient */
    text-decoration: none;
    font-weight: bold;
}
