/* style/game-rules.css */

/* Base styles for the page content */
.page-game-rules {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text for light background */
    background-color: var(--secondary-color); /* Matches body background: #FFFFFF */
}

/* Hero Section */
.page-game-rules__hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Adjust as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: var(--header-offset, 120px); /* Fixed header spacing */
    background-color: var(--primary-color); /* Fallback */
}

.page-game-rules__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.page-game-rules__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
    z-index: 2;
}

.page-game-rules__hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 20px;
    color: var(--secondary-color); /* White text */
}

.page-game-rules__hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--secondary-color); /* White */
    line-height: 1.2;
}

.page-game-rules__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--secondary-color); /* White */
}

.page-game-rules__hero-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* For mobile responsiveness */
}

/* General Section Styles */
.page-game-rules__intro-section,
.page-game-rules__general-rules,
.page-game-rules__fair-play-section,
.page-game-rules__faq-section,
.page-game-rules__cta-section {
    padding: 80px 0;
}

.page-game-rules__game-specific-rules,
.page-game-rules__responsible-gaming,
.page-game-rules__video-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Brand green */
    color: var(--secondary-color); /* White text */
}

.page-game-rules__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-game-rules__section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color); /* Brand green */
}

.page-game-rules__section-title--white {
    color: var(--secondary-color); /* White */
}

.page-game-rules__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
    color: #555555;
}

.page-game-rules__section-description--white {
    color: #e0e0e0;
}

.page-game-rules__paragraph {
    margin-bottom: 15px;
    font-size: 1em;
    line-height: 1.8;
}

/* Buttons */
.page-game-rules__btn-primary {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--register-button-bg); /* #C30808 */
    color: var(--button-text-color); /* #FFFF00 */
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 2px solid var(--register-button-bg);
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-game-rules__btn-primary:hover {
    background-color: #a30707; /* Darker red */
    border-color: #a30707;
    color: #ffffff;
}

.page-game-rules__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    background-color: transparent;
    color: var(--primary-color); /* Brand green */
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-game-rules__hero-cta-buttons .page-game-rules__btn-secondary {
    color: var(--secondary-color); /* White */
    border-color: var(--secondary-color); /* White */
}

.page-game-rules__hero-cta-buttons .page-game-rules__btn-secondary:hover {
    background-color: var(--secondary-color); /* White */
    color: var(--primary-color); /* Brand green */
}

.page-game-rules__btn-secondary:hover {
    background-color: var(--primary-color); /* Brand green */
    color: var(--secondary-color); /* White */
}

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

.page-game-rules__cta-buttons--center {
    margin-top: 40px;
}

/* Grid Layout */
.page-game-rules__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-game-rules__card {
    background-color: var(--secondary-color); /* White */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: #333333;
    transition: transform 0.3s ease;
    min-height: 250px; /* Ensure cards have some height */
    display: flex;
    flex-direction: column;
}

.page-game-rules__card:hover {
    transform: translateY(-5px);
}

.page-game-rules__card-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--primary-color); /* Brand green */
}

.page-game-rules__card-text {
    font-size: 1em;
    color: #555555;
}

/* Game Type Cards */
.page-game-rules__grid--game-types {
    margin-top: 50px;
}

.page-game-rules__game-card {
    display: block;
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent white on dark bg */
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: var(--secondary-color); /* White text */
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-game-rules__game-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.page-game-rules__game-card-title {
    font-size: 1.6em;
    margin-bottom: 10px;
    color: var(--secondary-color); /* White */
}

.page-game-rules__game-card-text {
    font-size: 0.95em;
    color: #e0e0e0;
}

/* Text with Image */
.page-game-rules__text-with-image {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-game-rules__text-content {
    flex: 1;
    min-width: 300px;
}

.page-game-rules__image-right {
    order: 2;
}

.page-game-rules__text-with-image .page-game-rules__content-image {
    flex: 1;
    min-width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* Ensure responsiveness */
    height: auto;
    display: block;
}

/* List styles */
.page-game-rules__list {
    list-style: none;
    padding: 0;
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-game-rules__list-item {
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent white on dark bg */
    padding: 25px;
    border-radius: 10px;
    color: var(--secondary-color); /* White text */
}

.page-game-rules__list-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--secondary-color); /* White */
}

.page-game-rules__list-text {
    font-size: 0.95em;
    color: #e0e0e0;
}

/* FAQ Section */
.page-game-rules__faq-list {
    max-width: 800px;
    margin: 50px auto 0 auto;
}

.page-game-rules__faq-item {
    background-color: var(--secondary-color); /* White */
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.page-game-rules__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color); /* Brand green */
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.page-game-rules__faq-question:hover {
    background-color: #f0f0f0;
}

.page-game-rules__faq-title {
    margin: 0;
    font-size: 1.1em;
    color: var(--primary-color); /* Brand green */
}

.page-game-rules__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
    color: #555555;
}

.page-game-rules__faq-item.active .page-game-rules__faq-toggle {
    transform: rotate(45deg); /* Change + to X or - */
}

.page-game-rules__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #333333;
    background-color: var(--secondary-color); /* White */
}

.page-game-rules__faq-item.active .page-game-rules__faq-answer {
    max-height: 1000px !important; /* Sufficiently large value */
    padding: 15px 25px 25px 25px;
}

.page-game-rules__faq-answer .page-game-rules__paragraph {
    margin-bottom: 0;
}

/* Video Section */
.page-game-rules__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 50px auto;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box; /* For responsiveness */
    width: 100%;
}

.page-game-rules__video-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.page-game-rules__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Content Images */
.page-game-rules__content-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 40px auto; /* Centered */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* CTA Content */
.page-game-rules__cta-content {
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-game-rules__hero-title {
        font-size: 2.8em;
    }
    .page-game-rules__section-title {
        font-size: 2em;
    }
    .page-game-rules__hero-section {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .page-game-rules__hero-section {
        height: 400px;
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile padding */
    }
    .page-game-rules__hero-title {
        font-size: 2em;
    }
    .page-game-rules__hero-description {
        font-size: 1em;
    }
    .page-game-rules__intro-section,
    .page-game-rules__general-rules,
    .page-game-rules__fair-play-section,
    .page-game-rules__faq-section,
    .page-game-rules__cta-section,
    .page-game-rules__game-specific-rules,
    .page-game-rules__responsible-gaming,
    .page-game-rules__video-section {
        padding: 40px 0;
    }
    .page-game-rules__section-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    .page-game-rules__section-description {
        margin-bottom: 30px;
    }
    .page-game-rules__grid {
        grid-template-columns: 1fr;
    }
    .page-game-rules__text-with-image {
        flex-direction: column;
    }
    .page-game-rules__image-right {
        order: initial;
    }
    .page-game-rules__list {
        grid-template-columns: 1fr;
    }

    /* Mobile image/video/button responsiveness */
    .page-game-rules img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-game-rules video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-game-rules__section,
    .page-game-rules__card,
    .page-game-rules__container,
    .page-game-rules__video-section,
    .page-game-rules__video-container,
    .page-game-rules__video-wrapper,
    .page-game-rules__cta-buttons,
    .page-game-rules__button-group,
    .page-game-rules__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }

    .page-game-rules__cta-button,
    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary,
    .page-game-rules a[class*="button"],
    .page-game-rules 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;
        margin-bottom: 10px; /* Stack buttons */
    }
    .page-game-rules__hero-cta-buttons,
    .page-game-rules__cta-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .page-game-rules__hero-cta-buttons a,
    .page-game-rules__cta-buttons a {
        width: 100%;
    }
}

/* Ensure content images are at least 200px wide in content areas */
.page-game-rules__content-image {
    min-width: 200px;
    min-height: 200px;
}

/* Specific overrides for color contrast */
.page-game-rules__dark-bg {
    background-color: var(--primary-color); /* #017439 */
    color: var(--secondary-color); /* #FFFFFF */
}

.page-game-rules__light-bg {
    background-color: var(--secondary-color); /* #FFFFFF */
    color: #333333;
}