:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --button-register-bg: #C30808;
    --button-register-text: #FFFFFF; /* Adjusted for WCAG AA compliance */
    --background-color: #FFFFFF;
}

/* Base styles for the page-cockfighting scope */
.page-cockfighting {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark); /* Default text color for light background */
    background-color: var(--background-color); /* Matches body background */
}

/* Section padding for desktop */
.page-cockfighting__section {
    padding: 60px 0;
}

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

.page-cockfighting__section-title {
    font-size: 36px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-cockfighting__section-description {
    font-size: 18px;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color-dark);
}

/* Hero Section */
.page-cockfighting__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); /* Subtle gradient */
    color: var(--text-color-light); /* Light text on gradient background */
}

.page-cockfighting__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-cockfighting__hero-image {
    width: 100%;
    margin-bottom: 30px;
    max-height: 500px; /* Constrain image height */
    overflow: hidden;
    border-radius: 8px;
}

.page-cockfighting__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    min-width: 200px; /* Min size requirement */
    min-height: 200px; /* Min size requirement */
}

.page-cockfighting__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    color: var(--text-color-light);
}

.page-cockfighting__main-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-color-light);
    font-weight: bold;
}

.page-cockfighting__intro-description {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--text-color-light);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-cockfighting__hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-cockfighting__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--primary-color);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-cockfighting__cta-button--register {
    background: var(--button-register-bg); /* Custom register color */
    color: var(--button-register-text); /* Custom register text color */
}

.page-cockfighting__cta-button--login {
    background: var(--button-register-bg); /* Custom login color */
    color: var(--button-register-text); /* Custom login text color */
}

.page-cockfighting__cta-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* General button styling */
.page-cockfighting__btn-primary {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-cockfighting__btn-primary:hover {
    background: #00602F; /* Darken primary color */
    opacity: 0.9;
}

.page-cockfighting__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-cockfighting__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-color-light);
}

.page-cockfighting__button-group {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-cockfighting__button-group--center {
    justify-content: center;
}

/* Content Grid */
.page-cockfighting__content-grid {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

.page-cockfighting__content-grid--reverse {
    flex-direction: row-reverse;
}

.page-cockfighting__text-block {
    flex: 1;
}

.page-cockfighting__image-block {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-cockfighting__image-block img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    min-width: 200px; /* Min size requirement */
    min-height: 200px; /* Min size requirement */
}

.page-cockfighting__list {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-color-dark);
}

.page-cockfighting__list li {
    margin-bottom: 10px;
    font-size: 16px;
}

/* Dark background section */
.page-cockfighting__dark-section {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.page-cockfighting__dark-section .page-cockfighting__section-title,
.page-cockfighting__dark-section .page-cockfighting__section-description,
.page-cockfighting__dark-section p,
.page-cockfighting__dark-section li,
.page-cockfighting__dark-section .page-cockfighting__btn-secondary {
    color: var(--text-color-light);
}

.page-cockfighting__dark-section .page-cockfighting__btn-secondary {
    border-color: var(--text-color-light);
}

.page-cockfighting__dark-section .page-cockfighting__btn-secondary:hover {
    background: var(--text-color-light);
    color: var(--primary-color);
}

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

.page-cockfighting__card {
    background: var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    color: var(--text-color-dark);
}

.page-cockfighting__card img {
    width: 100%;
    height: 200px; /* Fixed height for consistency in cards */
    object-fit: cover;
    margin-bottom: 15px;
    min-width: 200px; /* Min size requirement */
    min-height: 200px; /* Min size requirement */
}

.page-cockfighting__card-title {
    font-size: 22px;
    color: var(--primary-color);
    margin: 10px 15px;
    font-weight: bold;
}

.page-cockfighting__card-text {
    font-size: 16px;
    color: var(--text-color-dark);
    padding: 0 15px;
    flex-grow: 1;
}

/* FAQ Section */
.page-cockfighting__faq-list {
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* FAQ容器样式 */
.page-cockfighting__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.page-cockfighting__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo mở rộng */
.page-cockfighting__faq-item.active .page-cockfighting__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng!important để đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: var(--text-color-dark); /* Đảm bảo văn bản tối trên nền sáng */
}

/* Vấn đề kiểu */
.page-cockfighting__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-cockfighting__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-cockfighting__faq-question:active {
  background: #eeeeee;
}

/* Vấn đề tiêu đề kiểu */
.page-cockfighting__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện nhấp */
  color: var(--primary-color); /* Màu tiêu đề câu hỏi FAQ */
}

/* Chuyển đổi biểu tượng */
.page-cockfighting__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn biểu tượng chặn sự kiện nhấp */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-cockfighting__faq-item.active .page-cockfighting__faq-toggle {
  color: var(--primary-color);
  transform: rotate(180deg); /* Xoay cho dấu trừ */
}

/* Responsive Design */
@media (max-width: 992px) {
    .page-cockfighting__hero-section {
        padding: 40px 15px;
        padding-top: var(--header-offset, 120px) !important;
    }
    .page-cockfighting__main-title {
        font-size: 38px;
    }
    .page-cockfighting__intro-description {
        font-size: 18px;
    }
    .page-cockfighting__section-title {
        font-size: 30px;
    }
    .page-cockfighting__section-description {
        font-size: 16px;
    }
    .page-cockfighting__content-grid {
        flex-direction: column;
        gap: 30px;
    }
    .page-cockfighting__content-grid--reverse {
        flex-direction: column; /* Revert to default for mobile */
    }
    .page-cockfighting__card-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-cockfighting {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-cockfighting__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-cockfighting__main-title {
        font-size: 32px;
    }
    .page-cockfighting__intro-description {
        font-size: 16px;
    }
    .page-cockfighting__cta-button,
    .page-cockfighting__btn-primary,
    .page-cockfighting__btn-secondary,
    .page-cockfighting a[class*="button"],
    .page-cockfighting 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-cockfighting__hero-actions,
    .page-cockfighting__button-group {
      flex-direction: column;
      gap: 10px;
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
    }
    .page-cockfighting__section {
        padding: 40px 0;
    }
    .page-cockfighting__container {
        padding: 0 15px;
    }
    .page-cockfighting__section-title {
        font-size: 26px;
        margin-bottom: 15px;
    }
    .page-cockfighting__section-description {
        font-size: 15px;
        margin-bottom: 30px;
    }
    .page-cockfighting__image-block img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-cockfighting__section,
    .page-cockfighting__card,
    .page-cockfighting__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-cockfighting__card img {
         /* Adjust card image height for mobile */
    }

    /* FAQ Mobile */
    .page-cockfighting__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-cockfighting__faq-question h3 {
        font-size: 15px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-cockfighting__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-cockfighting__faq-answer {
        padding: 0 15px;
    }
    .page-cockfighting__faq-item.active .page-cockfighting__faq-answer {
        padding: 15px !important;
    }
}