/* Sections CSS - About, Categories, Event Details, FAQs, Rules */

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.about-content-left p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.about-logo-wrapper {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--color-shadow);
}

.about-logo-img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .about-logo-wrapper {
    order: -1;
  }
}

/* Race Categories */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.category-card {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-top: 5px solid var(--color-primary); /* Default top border blue */
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--color-shadow);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--color-shadow-hover);
  border-top-color: var(--color-accent); /* Toggle border red on hover */
}

.category-badge {
  background-color: rgba(8, 85, 150, 0.1);
  color: var(--color-primary);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-headlines);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 15px;
  align-self: flex-start;
}

.category-card:nth-child(even) .category-badge {
  background-color: rgba(236, 31, 40, 0.1);
  color: var(--color-accent);
}

.category-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.category-fee {
  font-size: 2.2rem;
  color: var(--color-accent);
  font-family: var(--font-headlines);
  font-weight: 800;
  margin: 15px 0;
}

.category-meta {
  list-style: none;
  margin-bottom: 25px;
  border-top: 1px solid var(--color-border);
  padding-top: 15px;
}

.category-meta li {
  font-size: 0.95rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--color-text-muted);
}

.category-meta li strong {
  color: var(--color-secondary);
}

.category-details {
  font-size: 0.95rem;
  margin-bottom: 25px;
  color: var(--color-text-muted);
  flex-grow: 1;
}

/* Event Details & Tabs */
.tabs-container {
  margin-top: 20px;
}

.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  list-style: none;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 15px;
}

.tab-btn {
  background: none;
  border: none;
  font-family: var(--font-headlines);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: 10px 25px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-speed) ease;
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -17px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.tab-panel {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--color-shadow);
}

.fallback-text {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 40px 0;
  font-style: italic;
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-bg-light);
}


/* Event Details Homepage Cards Grid */
.event-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 30px;
}

.event-detail-card {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: var(--color-shadow);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 360px;
}

.event-detail-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--color-shadow-hover);
  border-color: var(--color-primary);
}

.event-detail-icon-wrapper {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

.event-detail-icon {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.event-detail-card-title {
  font-family: var(--font-headlines);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 15px;
}

.event-detail-card-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
  flex-grow: 1;
}

.btn-card-action {
  display: inline-block;
  padding: 10px 28px;
  font-family: var(--font-headlines);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 30px;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary) !important;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-align: center;
}

.btn-card-action:hover {
  background-color: var(--color-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(8, 85, 150, 0.25);
}

@media (max-width: 991px) {
  .event-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .event-cards-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .event-detail-card {
    min-height: auto;
    padding: 30px 20px;
  }
}

/* Event Details Image Grid */
.detail-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.detail-img-wrapper {
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--color-shadow);
  height: 200px;
}

.detail-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.detail-img-wrapper:hover img {
  transform: scale(1.05);
}

/* Prize Money Responsive Table */
.prize-table-wrapper {
  overflow-x: auto;
  margin-top: 25px;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--color-shadow);
}

.prize-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: var(--color-bg-light);
}

.prize-table th, .prize-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
}

.prize-table th {
  background-color: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-headlines);
  font-weight: 700;
}

.prize-table tr:last-child td {
  border-bottom: none;
}

.prize-table tr:nth-child(even) td {
  background-color: rgba(8, 85, 150, 0.02);
}

/* FAQ Accordion */
.faq-search-box {
  max-width: 500px;
  margin: 0 auto 40px auto;
  position: relative;
}

.faq-search-input {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 30px;
  background-color: var(--color-bg-warm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-speed) ease;
}

.faq-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(8, 85, 150, 0.1);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-item {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--color-shadow);
  transition: all var(--transition-speed) ease;
}

.faq-header {
  width: 100%;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-headlines);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
  cursor: pointer;
}

.faq-header:hover {
  color: var(--color-primary);
}

.faq-icon {
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform var(--transition-speed) ease;
}

.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  background-color: var(--color-primary);
  transition: transform var(--transition-speed) ease;
}

/* Horizontal line */
.faq-icon::before {
  top: 11px;
  left: 4px;
  width: 16px;
  height: 2px;
}

/* Vertical line */
.faq-icon::after {
  top: 4px;
  left: 11px;
  width: 2px;
  height: 16px;
}

.faq-item.active .faq-icon {
  transform: rotate(135deg);
}

.faq-item.active .faq-icon::before, .faq-item.active .faq-icon::after {
  background-color: var(--color-accent);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-content {
  padding: 0 25px 20px 25px;
  font-size: 1rem;
  color: var(--color-text-muted);
  border-top: 1px solid transparent;
  white-space: pre-line;
}

.faq-item.active .faq-body {
  max-height: 500px; /* Big enough to fit text */
}

/* Rules Section */
.rules-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

.rules-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  align-self: start;
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--color-shadow);
}

.rules-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rules-nav-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-headlines);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding: 10px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.rules-nav-btn:hover {
  background-color: rgba(8, 85, 150, 0.05);
  color: var(--color-primary);
}

.rules-nav-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
}

.rules-content-area {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.rules-section-card {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--color-shadow);
}

.rules-section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 10px;
}

.rules-list {
  list-style: none;
  padding-left: 0;
}

.rules-list li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 15px;
  font-size: 1rem;
  color: var(--color-text-muted);
}

.rules-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: bold;
}

@media (max-width: 768px) {
  .rules-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .rules-sidebar {
    position: static;
  }
}
