/* Base Container */
.gamesalad-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Game Row */
.gamesalad-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* Original Game Card */
.gamesalad-original {
    flex: 0 0 300px;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Student Games Container */
.gamesalad-students {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Student Game Card */
.student-game {
    flex: 0 0 300px;
    min-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
}

/* Thumbnail Container */
.game-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: #f5f5f5;
    overflow: hidden;
}

.game-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Game Information */
.game-title {
    font-size: 16px;
    font-weight: bold;
    margin: 15px 15px 5px;
    color: #333;
}

.game-creator {
    font-size: 14px;
    color: #666;
    margin: 5px 15px 15px;
}

/* Description Overlay */
.game-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Play Button */
.play-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10;
}

/* Hover States */
.game-thumbnail:hover img {
    transform: scale(1.05);
}

.gamesalad-original:hover .game-description,
.student-game:hover .game-description {
    opacity: 1;
    transform: translateY(0);
}

.play-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.play-button:active {
    transform: scale(0.95);
}

/* No Image Placeholder */
.no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.close-lightbox {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 35px;
    cursor: pointer;
    z-index: 10000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    border: 2px solid white;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .gamesalad-container {
        padding: 10px !important;
    }

    .gamesalad-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        margin-bottom: 30px !important;
    }

    .gamesalad-original {
        flex: none !important;
        min-width: 0 !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    .gamesalad-students {
        display: flex !important;
        flex-direction: row !important;
        width: calc(100% + 20px) !important;
        margin-left: -10px !important;
        margin-right: -10px !important;
        padding: 0 10px !important;
        gap: 15px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .gamesalad-students::-webkit-scrollbar {
        display: none !important;
    }

    .student-game {
        flex: 0 0 85% !important;
        min-width: 85% !important;
        scroll-snap-align: center !important;
    }
}

/* Desktop Styles */
@media (min-width: 769px) {
    .gamesalad-students::-webkit-scrollbar {
        height: 8px;
    }

    .gamesalad-students::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .gamesalad-students::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    .gamesalad-students::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}