/* style/index-popular-games.css */
:root {
    --primary-color: #2F6BFF;
    --secondary-color: #6FA3FF;
    --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
    --card-bg: #FFFFFF;
    --background-general: #F4F7FB;
    --text-main: #1F2D3D;
    --text-dark: #000000;
    --border-color: #D6E2FF;
    --glow-color: #A5C4FF;
}

.page-index-popular-games {
    font-family: 'Arial', sans-serif;
    color: var(--text-main); /* Default text color for light background */
    background-color: var(--background-general);
}

.page-index-popular-games__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.page-index-popular-games__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px; /* Small top padding, assuming body handles header offset */
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
}

.page-index-popular-games__hero-image-wrapper {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
}

.page-index-popular-games__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; /* Desktop: cover to fill space */
}

.page-index-popular-games__hero-content {
    padding: 40px 20px;
    background-color: var(--card-bg); /* Use card background for content block */
    color: var(--text-main);
    width: 100%;
    box-sizing: border-box;
}

.page-index-popular-games__main-title {
    font-size: clamp(2em, 4vw, 3em);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-index-popular-games__description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-index-popular-games__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.page-index-popular-games__btn-primary,
.page-index-popular-games__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.page-index-popular-games__btn-primary {
    background: var(--button-gradient);
    color: #ffffff;
    border: 2px solid transparent;
}

.page-index-popular-games__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.page-index-popular-games__btn-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.page-index-popular-games__btn-secondary:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* General Sections */
.page-index-popular-games__overview-section,
.page-index-popular-games__advantages-section,
.page-index-popular-games__trust-section,
.page-index-popular-games__faq-section {
    padding: 60px 0;
    background-color: var(--background-general);
    color: var(--text-main);
}

.page-index-popular-games__game-showcase-section,
.page-index-popular-games__join-guide-section {
    padding: 60px 0;
    background-color: var(--primary-color);
    color: #ffffff;
}

.page-index-popular-games__section-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: inherit; /* Inherit color from section */
}

.page-index-popular-games__text-block {
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: justify;
}

/* Game Showcase */
.page-index-popular-games__game-category {
    margin-bottom: 60px;
}

.page-index-popular-games__game-category-title {
    font-size: 2em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: #ffffff;
}

.page-index-popular-games__game-item-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.page-index-popular-games__game-item-wrapper:nth-child(even) {
    flex-direction: row-reverse; /* Alternate image/text direction */
}

.page-index-popular-games__game-item-image {
    width: 50%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    min-height: 200px;
    object-fit: cover;
}

.page-index-popular-games__game-item-content {
    width: 50%;
    text-align: left;
    color: #ffffff;
}

.page-index-popular-games__game-item-content .page-index-popular-games__text-block {
    color: #ffffff;
}

/* Game Grid */
.page-index-popular-games__game-grid-title {
    font-size: 2em;
    font-weight: 600;
    text-align: center;
    margin-top: 60px;
    margin-bottom: 30px;
    color: #ffffff;
}

.page-index-popular-games__game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.page-index-popular-games__game-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 20px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-index-popular-games__game-card-image {
    width: 100%;
    height: 250px; /* Fixed height for consistent grid */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    min-width: 200px;
    min-height: 200px;
}

.page-index-popular-games__game-card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-index-popular-games__game-card-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-index-popular-games__game-card-title a:hover {
    color: var(--primary-color);
}

.page-index-popular-games__btn-play {
    display: inline-block;
    padding: 10px 20px;
    background: var(--button-gradient);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.page-index-popular-games__btn-play:hover {
    background: linear-gradient(180deg, #2F6BFF 0%, #4A8BFF 100%);
}

/* Advantages Section */
.page-index-popular-games__advantage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-index-popular-games__advantage-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
}

.page-index-popular-games__advantage-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    min-width: 200px;
    min-height: 200px;
    object-fit: cover;
}

.page-index-popular-games__advantage-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Join Guide Section */
.page-index-popular-games__guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-index-popular-games__guide-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
}

.page-index-popular-games__guide-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    min-width: 200px;
    min-height: 200px;
    object-fit: cover;
}

.page-index-popular-games__guide-title {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Trust Section */
.page-index-popular-games__trust-section .page-index-popular-games__section-title {
    color: var(--text-main);
}

.page-index-popular-games__trust-section .page-index-popular-games__text-block {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    color: var(--text-main);
}

/* FAQ Section */
.page-index-popular-games__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-index-popular-games__faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--text-main);
}

.page-index-popular-games__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--card-bg);
    color: var(--text-main);
    transition: background-color 0.3s ease;
}

.page-index-popular-games__faq-item[open] .page-index-popular-games__faq-question {
    background-color: var(--background-general);
}

.page-index-popular-games__faq-question:hover {
    background-color: var(--background-general);
}

.page-index-popular-games__faq-qtext {
    flex-grow: 1;
}

.page-index-popular-games__faq-toggle {
    font-size: 1.5em;
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.page-index-popular-games__faq-item[open] .page-index-popular-games__faq-toggle {
    transform: rotate(45deg);
}

.page-index-popular-games__faq-answer {
    padding: 0 25px 20px;
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-main);
}

/* --- Responsive Design --- */

/* Tablet and Mobile styles */
@media (max-width: 1024px) {
    .page-index-popular-games__container {
        padding: 15px;
    }

    .page-index-popular-games__main-title {
        font-size: clamp(1.8em, 5vw, 2.5em);
    }

    .page-index-popular-games__section-title {
        font-size: 2em;
    }

    .page-index-popular-games__game-item-wrapper {
        flex-direction: column;
    }

    .page-index-popular-games__game-item-wrapper:nth-child(even) {
        flex-direction: column; /* Reset order for mobile */
    }

    .page-index-popular-games__game-item-image,
    .page-index-popular-games__game-item-content {
        width: 100%;
    }

    .page-index-popular-games__game-item-content {
        text-align: center;
    }

    .page-index-popular-games__advantage-grid,
    .page-index-popular-games__guide-steps {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .page-index-popular-games__hero-image-wrapper {
        max-height: 400px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .page-index-popular-games {
        font-size: 16px;
        line-height: 1.6;
    }

    /* Hero Section */
    .page-index-popular-games__hero-section {
        padding-top: 10px !important;
    }

    .page-index-popular-games__hero-image-wrapper {
        max-height: none;
    }

    .page-index-popular-games__hero-image {
        object-fit: contain !important; /* Mobile: contain to show full image */
        height: auto !important;
        aspect-ratio: unset !important;
    }

    .page-index-popular-games__hero-content {
        padding: 30px 15px;
    }

    .page-index-popular-games__main-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .page-index-popular-games__description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .page-index-popular-games__cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px;
    }

    .page-index-popular-games__btn-primary,
    .page-index-popular-games__btn-secondary,
    .page-index-popular-games a[class*="button"],
    .page-index-popular-games a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 15px;
        font-size: 1em;
    }

    /* General Sections */
    .page-index-popular-games__overview-section,
    .page-index-popular-games__advantages-section,
    .page-index-popular-games__trust-section,
    .page-index-popular-games__faq-section,
    .page-index-popular-games__game-showcase-section,
    .page-index-popular-games__join-guide-section {
        padding: 40px 0;
    }

    .page-index-popular-games__section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .page-index-popular-games__text-block {
        font-size: 0.95em;
    }

    /* Game Showcase */
    .page-index-popular-games__game-category-title {
        font-size: 1.6em;
    }

    .page-index-popular-games__game-item-image {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }

    .page-index-popular-games__game-grid-title {
        font-size: 1.6em;
    }

    .page-index-popular-games__game-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-index-popular-games__game-card-image {
        height: auto !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }

    .page-index-popular-games__game-card-title {
        font-size: 1.2em;
    }

    .page-index-popular-games__btn-play {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    /* Advantage Grid */
    .page-index-popular-games__advantage-grid,
    .page-index-popular-games__guide-steps {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .page-index-popular-games__advantage-image,
    .page-index-popular-games__guide-image {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }

    .page-index-popular-games__advantage-item,
    .page-index-popular-games__guide-item {
        padding: 25px;
    }

    /* FAQ Section */
    .page-index-popular-games__faq-question {
        padding: 15px 20px;
        font-size: 1em;
    }

    .page-index-popular-games__faq-answer {
        padding: 0 20px 15px;
    }

    /* Universal image and container responsive styles */
    .page-index-popular-games img {
      max-width: 100% !important;
      width: 100% !important;
      height: auto !important;
      display: block !important;
    }

    .page-index-popular-games__container,
    .page-index-popular-games__hero-section,
    .page-index-popular-games__overview-section,
    .page-index-popular-games__game-showcase-section,
    .page-index-popular-games__advantages-section,
    .page-index-popular-games__join-guide-section,
    .page-index-popular-games__trust-section,
    .page-index-popular-games__faq-section,
    .page-index-popular-games__card,
    .page-index-popular-games__game-card,
    .page-index-popular-games__advantage-item,
    .page-index-popular-games__guide-item {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      overflow-x: hidden;
    }
}