/* style/game-bai.css */

/* Variables from custom palette */
:root {
    --page-game-bai-primary-color: #113B7A;
    --page-game-bai-secondary-color: #1D5FD1;
    --page-game-bai-button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    --page-game-bai-card-bg: #10233F;
    --page-game-bai-text-main: #F3F8FF;
    --page-game-bai-text-secondary: #AFC4E8;
    --page-game-bai-border-color: #244D84;
    --page-game-bai-glow-color: #4FA8FF;
    --page-game-bai-gold-color: #F2C14E;
    --page-game-bai-divider-color: #1B3357;
    --page-game-bai-deep-navy: #08162B; /* This should match body background from shared.css */
}

.page-game-bai {
    background-color: var(--page-game-bai-deep-navy);
    color: var(--page-game-bai-text-main);
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.page-game-bai__container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Section Titles and Descriptions */
.page-game-bai__section-title {
    font-size: 32px;
    color: var(--page-game-bai-text-main);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-game-bai__section-description {
    font-size: 18px;
    color: var(--page-game-bai-text-secondary);
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.page-game-bai__btn-primary,
.page-game-bai__btn-secondary,
.page-game-bai__btn-tertiary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}

.page-game-bai__btn-primary {
    background: var(--page-game-bai-button-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-game-bai__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.page-game-bai__btn-secondary {
    background: transparent;
    color: var(--page-game-bai-gold-color);
    border: 2px solid var(--page-game-bai-gold-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-game-bai__btn-secondary:hover {
    background: var(--page-game-bai-gold-color);
    color: var(--page-game-bai-deep-navy);
    transform: translateY(-2px);
}

.page-game-bai__btn-tertiary {
    background: var(--page-game-bai-secondary-color);
    color: #ffffff;
    border: none;
}

.page-game-bai__btn-tertiary:hover {
    background: var(--page-game-bai-primary-color);
}

/* Images */
.page-game-bai img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* HERO Section */
.page-game-bai__hero-section {
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    background-color: var(--page-game-bai-deep-navy);
}

.page-game-bai__hero-container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 40px 16px;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    align-items: center;
    gap: 40px;
    box-sizing: border-box;
}

.page-game-bai__hero-content {
    flex: 1 1 45%;
    min-width: 300px;
    color: var(--page-game-bai-text-main);
}

.page-game-bai__hero-title {
    font-size: clamp(32px, 4.5vw, 48px); /* H1 font size with clamp */
    color: var(--page-game-bai-gold-color);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-game-bai__hero-description {
    font-size: 18px;
    color: var(--page-game-bai-text-secondary);
    margin-bottom: 30px;
}

.page-game-bai__hero-cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allows buttons to wrap */
}

.page-game-bai__hero-image {
    flex: 1 1 45%;
    min-width: 300px;
    text-align: center;
}

.page-game-bai__hero-image img {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Intro Section */
.page-game-bai__intro-section {
    padding: 60px 0;
    background-color: var(--page-game-bai-card-bg); /* Darker background for contrast */
}

.page-game-bai__intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-game-bai__intro-item {
    text-align: center;
    padding: 25px;
    background-color: var(--page-game-bai-deep-navy);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--page-game-bai-border-color);
}

.page-game-bai__icon-box-media {
    width: 200px; /* Fixed size for circular image */
    height: 200px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--page-game-bai-gold-color);
    box-shadow: 0 0 15px var(--page-game-bai-glow-color);
}

.page-game-bai__icon-box-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.page-game-bai__intro-item-title {
    font-size: 24px;
    color: var(--page-game-bai-gold-color);
    margin-bottom: 15px;
    font-weight: bold;
}

.page-game-bai__intro-item-text {
    font-size: 16px;
    color: var(--page-game-bai-text-secondary);
}

/* Game Categories Section */
.page-game-bai__game-categories-section {
    padding: 60px 0;
    background-color: var(--page-game-bai-deep-navy);
}

.page-game-bai__game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-game-bai__game-card {
    background-color: var(--page-game-bai-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--page-game-bai-border-color);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards are same height */
}

.page-game-bai__game-card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistent card images */
    object-fit: cover;
    display: block;
}

.page-game-bai__game-card-title {
    font-size: 22px;
    color: var(--page-game-bai-gold-color);
    margin: 20px 20px 10px;
    font-weight: bold;
}

.page-game-bai__game-card-title a {
    color: inherit;
    text-decoration: none;
}

.page-game-bai__game-card-title a:hover {
    text-decoration: underline;
}

.page-game-bai__game-card-text {
    font-size: 16px;
    color: var(--page-game-bai-text-secondary);
    padding: 0 20px;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes button to bottom */
}

.page-game-bai__game-card .page-game-bai__btn-tertiary {
    margin: 0 20px 20px;
    align-self: flex-start; /* Aligns button to start of flex item */
    width: auto; /* Allow button to shrink */
}


/* Guide Section */
.page-game-bai__guide-section {
    padding: 60px 0;
    background-color: var(--page-game-bai-card-bg);
}

.page-game-bai__guide-content {
    max-width: 800px;
    margin: 0 auto;
    color: var(--page-game-bai-text-secondary);
}

.page-game-bai__guide-content p {
    margin-bottom: 20px;
    font-size: 17px;
}

.page-game-bai__guide-list {
    list-style: decimal;
    padding-left: 25px;
    margin-bottom: 30px;
}

.page-game-bai__guide-list li {
    margin-bottom: 10px;
    font-size: 17px;
}

.page-game-bai__guide-list strong {
    color: var(--page-game-bai-gold-color);
}

.page-game-bai__guide-section .page-game-bai__btn-primary {
    display: block;
    width: fit-content;
    margin: 0 auto;
}

/* FAQ Section */
.page-game-bai__faq-section {
    padding: 60px 0;
    background-color: var(--page-game-bai-deep-navy);
}

.page-game-bai__faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.page-game-bai__faq-item {
    background-color: var(--page-game-bai-card-bg);
    border: 1px solid var(--page-game-bai-border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-game-bai__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 18px;
    font-weight: bold;
    color: var(--page-game-bai-gold-color);
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.page-game-bai__faq-question:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.page-game-bai__faq-item[open] .page-game-bai__faq-question {
    background-color: rgba(0, 0, 0, 0.2);
}

.page-game-bai__faq-toggle {
    font-size: 24px;
    line-height: 1;
    margin-left: 15px;
    pointer-events: none; /* Prevent click on toggle icon itself */
}

/* Hide default details marker */
.page-game-bai__faq-item summary::-webkit-details-marker {
    display: none;
}
.page-game-bai__faq-item summary::marker {
    display: none;
}

.page-game-bai__faq-answer {
    padding: 0 25px 18px;
    font-size: 16px;
    color: var(--page-game-bai-text-secondary);
    line-height: 1.7;
}

/* CTA Section (final) */
.page-game-bai__cta-section {
    padding: 60px 0;
    background-color: var(--page-game-bai-card-bg);
    text-align: center;
}

.page-game-bai__cta-section .page-game-bai__section-description {
    margin-bottom: 30px;
}

.page-game-bai__cta-section .page-game-bai__cta-buttons {
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* --- Responsive Styles --- */
@media (max-width: 1024px) {
    .page-game-bai__hero-title {
        font-size: clamp(30px, 4vw, 42px);
    }
    .page-game-bai__section-title {
        font-size: 28px;
    }
    .page-game-bai__hero-container {
        flex-direction: column;
        text-align: center;
    }
    .page-game-bai__hero-content,
    .page-game-bai__hero-image {
        flex: 1 1 100%;
        min-width: unset;
    }
    .page-game-bai__hero-cta-buttons {
        justify-content: center;
    }
}


@media (max-width: 768px) {
    /* General Mobile Adjustments */
    .page-game-bai {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-game-bai__container {
        padding: 0 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Section Titles and Descriptions */
    .page-game-bai__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-game-bai__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    /* Buttons */
    .page-game-bai__btn-primary,
    .page-game-bai__btn-secondary,
    .page-game-bai__btn-tertiary,
    .page-game-bai a[class*="button"],
    .page-game-bai 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-left: 15px;
        padding-right: 15px;
    }
    .page-game-bai__hero-cta-buttons,
    .page-game-bai__cta-section .page-game-bai__cta-buttons {
        flex-direction: column !important;
        gap: 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-game-bai__guide-section .page-game-bai__btn-primary {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Images */
    .page-game-bai img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* HERO Section */
    .page-game-bai__hero-section {
        padding-top: 10px !important;
        padding-bottom: 40px;
    }
    .page-game-bai__hero-container {
        padding: 30px 15px;
        gap: 30px;
    }
    .page-game-bai__hero-title {
        font-size: 34px;
        text-align: center;
    }
    .page-game-bai__hero-description {
        font-size: 17px;
        text-align: center;
    }
    .page-game-bai__hero-image img {
        height: auto;
    }

    /* Intro Section (Module 1 three-column circular images) */
    .page-game-bai__intro-section {
        padding: 40px 0;
    }
    .page-game-bai__intro-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .page-game-bai__icon-box-media {
        width: 150px;
        height: 150px;
        border-width: 2px;
    }
    .page-game-bai__intro-item-title {
        font-size: 20px;
    }
    .page-game-bai__intro-item-text {
        font-size: 15px;
    }

    /* Game Categories Section */
    .page-game-bai__game-categories-section {
        padding: 40px 0;
    }
    .page-game-bai__game-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .page-game-bai__game-card-image {
        height: 180px;
    }
    .page-game-bai__game-card-title {
        font-size: 20px;
        margin: 15px 15px 10px;
    }
    .page-game-bai__game-card-text {
        font-size: 15px;
        padding: 0 15px;
    }
    .page-game-bai__game-card .page-game-bai__btn-tertiary {
        margin: 0 15px 15px;
        width: calc(100% - 30px) !important;
        max-width: calc(100% - 30px) !important;
    }


    /* Guide Section */
    .page-game-bai__guide-section {
        padding: 40px 0;
    }
    .page-game-bai__guide-content {
        padding: 0 15px;
    }
    .page-game-bai__guide-content p,
    .page-game-bai__guide-list li {
        font-size: 16px;
    }

    /* FAQ Section */
    .page-game-bai__faq-section {
        padding: 40px 0;
    }
    .page-game-bai__faq-item {
        margin-bottom: 10px;
    }
    .page-game-bai__faq-question {
        padding: 15px 20px;
        font-size: 16px;
    }
    .page-game-bai__faq-answer {
        padding: 0 20px 15px;
        font-size: 15px;
    }

    /* CTA Section (final) */
    .page-game-bai__cta-section {
        padding: 40px 0;
    }
    .page-game-bai__cta-section .page-game-bai__section-title {
        font-size: 26px;
    }
    .page-game-bai__cta-section .page-game-bai__section-description {
        font-size: 16px;
        margin-bottom: 25px;
    }
}