/* =========================================== */
/*   GAME DETAILS PAGE - NEON CYBER THEME      */
/* =========================================== */

/* 1. MAIN CONTAINER */
.container-game-details {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 2. LOADING AND ERROR STATES */
.state-loading {
  text-align: center;
  font-size: 18px;
  color: var(--color-primary);
  padding: 60px 0;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.container-error {
  text-align: center;
  padding: 60px 0;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  border: 1px solid var(--color-border);
}

.container-error h2 {
  color: var(--color-error);
  margin-bottom: 15px;
  text-shadow: 0 0 15px rgba(255, 49, 49, 0.3);
}

/* 3. BACK BUTTON */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
  padding: 10px 18px;
  transition: all var(--transition-normal);
  background: transparent;
  font-size: 16px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
}

.link-back:hover {
  background: var(--color-primary-hover);
  color: white;
  transform: translateX(-5px);
  box-shadow: var(--shadow-md);
}

/* 4. NEW LAYOUT (2-COLUMN) */
.game-details-layout {
    display: grid;
    grid-template-columns: 1fr 340px; /* Main content + Sidebar */
    gap: 30px;
    align-items: start;
}

/* Left Column: Hero Card */
.game-hero-card {
    background: #ffffff; /* Light gray background */
    border-radius: 20px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    height: 678px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Abstract background shapes - Overlapping Circles */
.game-hero-card::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(248, 248, 248); /* Top White Circle (Strongest) */
    border-radius: 50%;
    z-index: 0;
}

.game-hero-card::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    right: -46%;
    transform: translateY(-50%);
    background: #f3f3f3; /* Right Circle (Medium - 2nd Layer) */
    border-radius: 50%;
    z-index: 1;
}

.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}

.shape-bottom {
    width: 100%;
    height: 100%;
    bottom: -50%;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(233, 233, 233, 0.6); /* Bottom Circle (Strong - 3rd Layer) */
    z-index: 2;
}

.shape-left {
    width: 100%;
    height: 100%;
    top: 50%;
    left: -46%;
    transform: translateY(-50%);
    background: rgb(227, 227, 227, 0.6); /* Left Circle (Strongest - Top Layer) */
    z-index: 3;
}

.hero-game-image-wrapper {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10; /* Increased z-index to be above shapes */
    background: white;
    margin: 40px auto 25px;
    flex-shrink: 0;
}

.hero-game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-game-title {
    font-size: 2rem;
    font-weight: 800;
    color: #4C35E0; /* Deep Purple/Blue */
    margin-bottom: 10px;
    line-height: 1.2;
    z-index: 10; /* Increased z-index */
    position: relative;
}

.hero-game-developer {
    font-size: 1rem;
    color: #666;
    margin-bottom: 30px;
    z-index: 10; /* Increased z-index */
    position: relative;
}

.hero-play-btn {
    background: #4C35E0;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 60px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(76, 53, 224, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10; /* Increased z-index */
    position: relative;
}

.hero-play-btn:hover {
    background: #3a26b5;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(76, 53, 224, 0.4);
}

.hero-play-btn i {
    font-size: 1.4rem;
}

/* Description Section */
.game-description-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.game-description-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

.container-game-description-text {
    line-height: 1.8;
    color: #555;
    font-size: 16px;
}

.container-game-description-text p {
    margin-bottom: 15px;
}

.container-game-description-text img {
    max-width: 100%;
    border-radius: 12px;
}

/* Right Column: Sidebar */
.game-sidebar-column {
    background: transparent;
}

.sidebar-title {
    color: #4C35E0;
    font-size: 1.2rem; /* Smaller font size like "Similar Games" in image */
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: none;
}

.grid-similar-games.sidebar-mode {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Compact Similar Game Card for Sidebar */
.card-similar-game-sidebar {
    background: transparent; /* No background */
    overflow: hidden; /* Ensure content stays within bounds */
    box-shadow: none; /* No shadow */
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    gap: 8px; /* Gap between image and text */
    min-width: 0; /* Critical: prevents grid item from overflowing */
    width: 100%; /* Ensure it takes full width of grid cell */
}

.card-similar-game-sidebar:hover {
    transform: none; /* Remove lift */
    box-shadow: none;
}

.sidebar-game-image-wrapper {
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
    position: relative;
    background: #eee;
    border-radius: 16px; /* Rounded image corners */
    overflow: hidden;
}

.sidebar-game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-similar-game-sidebar:hover .sidebar-game-image {
    transform: scale(1.05); /* Zoom effect on hover */
}

.sidebar-game-info {
    padding: 0; /* No padding */
}

.sidebar-game-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-game-dev {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

/* COLLECTIONS SECTION - Reused from Home */
.collections-section {
    padding-top: 60px;
    padding-bottom: 40px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.collection-card {
    position: relative;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.collection-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 1;
}

.collection-card:hover .collection-bg-image {
    transform: scale(1.05);
}

.collection-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

/* Card Specific Styles (Gradients) */
.style-exclusive .collection-content {
    background: linear-gradient(180deg, rgba(82, 107, 255, 0) 0%, rgba(68, 48, 230, 0.9) 100%);
}

.style-hot .collection-content {
    background: linear-gradient(180deg, rgba(255, 117, 85, 0) 0%, rgba(212, 53, 22, 0.9) 100%);
}

.style-brain .collection-content {
    background: linear-gradient(180deg, rgba(63, 206, 158, 0) 0%, rgba(13, 161, 107, 0.9) 100%);
}

.style-purchase .collection-content {
    background: linear-gradient(180deg, rgba(160, 97, 255, 0) 0%, rgba(95, 43, 226, 0.9) 100%);
}


.collection-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-info h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.collection-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.collection-btn {
    background: #4C35E0;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.collection-btn:hover {
    background: #6a55e6;
    transform: translateX(2px);
}

.collection-btn i {
    font-size: 0.7rem;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    background: #000;
}

.game-hero-card.playing {
    padding: 0;
    background: #000;
}

.game-hero-card.playing .hero-game-image-wrapper,
.game-hero-card.playing .hero-game-title,
.game-hero-card.playing .hero-game-developer,
.game-hero-card.playing .hero-play-btn,
.game-hero-card.playing .hero-bg-shape,
.game-hero-card.playing::before,
.game-hero-card.playing::after {
    display: none;
}
.modal-game {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none; /* Hidden by default */
}

.modal-game-content {
  width: 95%;
  height: 95%;
  background: var(--color-bg-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-game-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.title-modal-game {
  font-weight: 700;
  font-size: 18px;
  color: #333;
}

.button-close-modal-game {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

.modal-game-body {
  flex: 1;
  background: #000;
}

#gameIframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 6. MOBILE RESPONSIVE */
@media (max-width: 992px) {
    .game-details-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-sidebar-column {
        margin-top: 20px;
    }
    
    .grid-similar-games.sidebar-mode {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .container-game-details {
        padding: var(--container-padding);
    }
    
    .game-hero-card {
        padding: 30px 15px;
        height: auto;
        min-height: 400px;
        margin-bottom: 20px;
    }

    .game-description-section {
        padding: 20px;
    }

    .game-description-section h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .collections-section {
        padding-top: 30px;
        margin-top: 20px;
    }

    .collections-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 12px;
    }

    .collection-card {
        height: 140px;
    }

    .collection-info h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-hero-card {
        padding: 25px 10px;
    }
    
    .hero-game-image-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .hero-game-title {
        font-size: 1.3rem;
    }
    
    .hero-play-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .grid-similar-games.sidebar-mode {
        gap: 6px;
    }

    .collections-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 8px;
    }

    .collection-card {
        height: 120px;
    }
}
