/* style/resources.css */

/* General styles for the resources page */
.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background: #ffffff; /* Default body background */
}

.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.page-resources__section-title {
  font-size: 36px;
  font-weight: bold;
  color: #017439; /* Primary color for titles */
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-resources__section-description {
  font-size: 18px;
  color: #555555;
  text-align: center;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Button styles */
.page-resources__btn-primary,
.page-resources__btn-secondary,
.page-resources__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box;
  max-width: 100%; /* Ensure responsiveness */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-resources__btn-primary {
  background: #017439;
  color: #ffffff;
  border: 2px solid #017439;
}

.page-resources__btn-primary:hover {
  background: #005f2e;
  border-color: #005f2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-secondary {
  background: #ffffff;
  color: #017439;
  border: 2px solid #017439;
}

.page-resources__btn-secondary:hover {
  background: #f0f0f0;
  color: #005f2e;
  border-color: #005f2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Specific button colors for login/register from custom color rules */
.page-resources__btn-register {
  background: #C30808;
  color: #FFFF00;
  border: 2px solid #C30808;
}
.page-resources__btn-register:hover {
  background: #a30606;
  border-color: #a30606;
}

.page-resources__btn-login {
  background: #C30808;
  color: #FFFF00;
  border: 2px solid #C30808;
}
.page-resources__btn-login:hover {
  background: #a30606;
  border-color: #a30606;
}


/* Hero Section */
.page-resources__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); /* Fixed header offset */
  background: linear-gradient(135deg, #017439, #005f2e); /* Gradient background for visual appeal */
  color: #ffffff;
}

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

.page-resources__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

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

.page-resources__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-resources__hero-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #ffffff;
}

.page-resources__hero-content p {
  font-size: 20px;
  margin-bottom: 40px;
  color: #f0f0f0;
}

.page-resources__hero-cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Section backgrounds */
.page-resources__light-bg {
  background: #ffffff;
  color: #333333;
}

.page-resources__dark-bg {
  background: #017439;
  color: #ffffff;
}

.page-resources__dark-bg .page-resources__section-title {
  color: #ffffff;
}

.page-resources__dark-bg .page-resources__section-description {
  color: #f0f0f0;
}

.page-resources__dark-bg p,
.page-resources__dark-bg li {
  color: #f0f0f0;
}

/* Introduction Section */
.page-resources__introduction-section {
  padding: 80px 0;
}

/* Game Guides Section */
.page-resources__game-guides-section {
  padding: 80px 0;
}

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

.page-resources__guide-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #333333;
}

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

.page-resources__guide-card img {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-resources__guide-card h3 {
  font-size: 22px;
  margin: 20px 20px 10px;
  line-height: 1.3;
}

.page-resources__guide-card h3 a {
  color: #017439;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__guide-card h3 a:hover {
  color: #005f2e;
}

.page-resources__guide-card p {
  font-size: 16px;
  margin: 0 20px 20px;
  flex-grow: 1; /* Make paragraphs take available space */
}

.page-resources__guide-card .page-resources__btn-secondary {
  margin: 0 20px 20px;
  align-self: flex-start; /* Align button to start */
}


/* News & Updates Section */
.page-resources__news-updates-section {
  padding: 80px 0;
}

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

.page-resources__news-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #333333;
}

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

.page-resources__news-card img {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-resources__news-card h3 {
  font-size: 20px;
  margin: 20px 20px 10px;
  line-height: 1.3;
}

.page-resources__news-card h3 a {
  color: #017439;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__news-card h3 a:hover {
  color: #005f2e;
}

.page-resources__news-card p {
  font-size: 15px;
  margin: 0 20px 15px;
  flex-grow: 1;
}

.page-resources__news-date {
  font-size: 14px;
  color: #888888;
  margin: 0 20px 20px;
}

.page-resources__view-all-button {
  text-align: center;
  margin-top: 50px;
}


/* Tips & Strategies Section */
.page-resources__tips-strategies-section {
  padding: 80px 0;
}

.page-resources__tips-list {
  list-style: none;
  padding: 0;
  margin: 40px auto;
  max-width: 800px;
  text-align: left;
}

.page-resources__tips-list li {
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
  padding: 15px 20px;
  border-left: 5px solid #FFFF00; /* Highlight with yellow */
  border-radius: 8px;
  font-size: 17px;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-resources__tips-list li strong {
  color: #FFFF00;
}

.page-resources__tips-image {
  text-align: center;
  margin-top: 40px;
}

.page-resources__tips-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  min-height: 200px;
}


/* FAQ Section */
.page-resources__faq-section {
  padding: 80px 0;
}

/* FAQ容器样式 */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* 问题样式 */
.page-resources__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-resources__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

/* 问题标题样式 */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: #333333;
}

/* 切换图标 */
.page-resources__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; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: #333;
}

.page-resources__faq-answer p {
    color: #555555;
    font-size: 15px;
    margin-top: 0;
}

.page-resources__faq-download-buttons {
    margin-top: 20px;
    text-align: left;
}


/* Contact & Support Section */
.page-resources__contact-support-section {
  padding: 80px 0;
  text-align: center;
}

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

.page-resources__contact-info {
  margin-top: 40px;
  font-size: 16px;
  color: #f0f0f0;
}

.page-resources__contact-info a {
  color: #FFFF00; /* Yellow for links on dark background */
  text-decoration: underline;
  transition: color 0.3s ease;
}

.page-resources__contact-info a:hover {
  color: #ffffff;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-resources__container {
    padding: 30px 15px;
  }

  .page-resources__hero-content h1 {
    font-size: 40px;
  }

  .page-resources__hero-content p {
    font-size: 18px;
  }

  .page-resources__section-title {
    font-size: 30px;
  }

  .page-resources__section-description {
    font-size: 16px;
  }

  .page-resources__guide-card h3 {
    font-size: 20px;
  }

  .page-resources__news-card h3 {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile fixed header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-resources__hero-image img {
    border-radius: 4px;
    min-width: unset; /* Reset min-width for mobile */
    min-height: unset; /* Reset min-height for mobile */
  }
  
  .page-resources__hero-content h1 {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .page-resources__hero-content p {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-resources__hero-cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 15px;
  }

  .page-resources__btn-primary,
  .page-resources__btn-secondary,
  .page-resources__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-resources__hero-cta-buttons .page-resources__cta-button {
    margin: 0; /* Remove margin from individual buttons if stacked */
  }

  .page-resources__section-title {
    font-size: 28px;
  }

  .page-resources__section-description {
    font-size: 15px;
    margin-bottom: 30px;
  }

  .page-resources__guides-grid,
  .page-resources__news-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .page-resources__guide-card img,
  .page-resources__news-card img {
     /* Adjust image height for mobile cards */
    min-width: unset;
    min-height: unset;
  }

  .page-resources__guide-card h3,
  .page-resources__news-card h3 {
    font-size: 18px;
    margin: 15px 15px 8px;
  }

  .page-resources__guide-card p,
  .page-resources__news-card p {
    font-size: 14px;
    margin: 0 15px 15px;
  }

  .page-resources__guide-card .page-resources__btn-secondary {
    margin: 0 15px 15px;
  }

  .page-resources__tips-list {
    margin: 30px auto;
  }

  .page-resources__tips-list li {
    font-size: 15px;
    padding: 12px 15px;
  }

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

  .page-resources__contact-buttons {
    flex-direction: column;
    gap: 15px;
  }

  /* Ensure all images are responsive and do not overflow */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-resources__section,
  .page-resources__card,
  .page-resources__container,
  .page-resources__hero-container,
  .page-resources__hero-image,
  .page-resources__hero-content,
  .page-resources__hero-cta-buttons,
  .page-resources__guides-grid,
  .page-resources__guide-card,
  .page-resources__news-grid,
  .page-resources__news-card,
  .page-resources__tips-list,
  .page-resources__tips-image,
  .page-resources__faq-section,
  .page-resources__faq-item,
  .page-resources__contact-support-section,
  .page-resources__contact-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px; /* Add padding to content containers */
    padding-right: 15px; /* Add padding to content containers */
  }
  .page-resources__container {
    padding-left: 0 !important; /* Reset specific container padding if already set */
    padding-right: 0 !important; /* Reset specific container padding if already set */
  }
}