/*
============================================
=         Subathon History Page            =
============================================
*/
main {
  background-color: var(--togichu-black);
  min-height: 100vh;
}

.history-container {
  background-color: var(--togichu-black);
  padding: 2rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  overflow: visible;
}

/*
============================================
=              Hero Section                =
============================================
*/
.history-hero {
  text-align: center;
  max-width: 1280px;
  margin: 0 auto 4rem;
  padding: 2rem 0;
}

.history-title {
  font-family: var(--font-grotesk);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--togichu-magenta);
  margin-bottom: 0.5rem;
  line-height: 1;
  opacity: 0;
}

.history-subtitle {
  font-family: var(--font-inter);
  font-size: 1.25rem;
  color: #32b8c6;
  margin: 0;
  font-weight: 300;
  opacity: 0;
}

/*
============================================
=            Search Bar                    =
============================================
*/
.history-search-wrapper {
  max-width: 600px;
  margin: 0 auto 3rem;
  opacity: 0;
}

.history-search {
  width: 100%;
  padding: 1rem 1.5rem;
  background-color: var(--togichu-charcoal);
  border: 2px solid rgba(223, 64, 120, 0.3);
  border-radius: 50px;
  font-family: var(--font-inter);
  font-size: 1rem;
  color: var(--togichu-peach);
  transition: all 0.3s ease;
}

.history-search::placeholder {
  color: rgba(245, 213, 200, 0.5);
}

.history-search:focus {
  outline: none;
  border-color: var(--togichu-magenta);
  box-shadow: 0 0 20px rgba(223, 64, 120, 0.3);
}

/*
============================================
=        Search Highlight                  =
============================================
*/
.contributor-card.highlight-match {
  border-color: var(--togichu-magenta);
  box-shadow: none;
}

.contributor-card.highlight-match::before {
  left: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(223, 64, 120, 0.15) 25%,
    rgba(223, 64, 120, 0.35) 50%,
    rgba(223, 64, 120, 0.5) 75%,
    var(--togichu-pink) 100%
  );
}

.contributor-card.highlight-match .contributor-name,
.contributor-card.highlight-match .type-badge {
  color: white;
}

/*
============================================
=          Subathons List                  =
============================================
*/
.subathons-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  opacity: 0;
  padding: 2rem 0;
  overflow: visible;
}

.subathon-item {
  position: relative;
  border-radius: 1rem;
  overflow: visible;
}

.subathon-item::before {
  content: '';
  position: absolute;
  inset: -22px;
  background: radial-gradient(
    ellipse at center,
    rgba(223, 64, 120, 0.55) 0%,
    rgba(223, 64, 120, 0.25) 45%,
    transparent 72%
  );
  border-radius: 1.6rem;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 0;
  filter: blur(18px);
  pointer-events: none;
}

.subathon-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border: 1px solid rgba(223, 64, 120, 0.2);
  border-radius: 1rem;
  transition: border-color 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.subathon-item:hover::before {
  opacity: 1;
}

.subathon-item:hover::after {
  border-color: rgba(223, 64, 120, 0.5);
}

/*
============================================
=         Subathon Header                  =
============================================
*/
.hidden-checkbox {
  display: none;
}

.subathon-header,
.expandable-content {
  position: relative;
  z-index: 2;
}

.subathon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
  background: transparent;
}

.subathon-item:hover .subathon-header {
  background-color: rgba(255, 20, 147, 0.05);
}

.subathon-header:hover {
  background-color: rgba(255, 20, 147, 0.05);
}

.subathon-header-content {
  flex: 1;
}

.subathon-title {
  font-family: var(--font-grotesk);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--togichu-magenta);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.subathon-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #32b8c6;
  margin: 0;
}

.subathon-date,
.subathon-contributors {
  color: #a7a9a9;
}

.subathon-separator {
  color: rgba(223, 64, 120, 0.5);
}

.toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--togichu-magenta);
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(223, 64, 120, 0.1);
}

.hidden-checkbox:checked ~ .subathon-header .toggle-icon {
  transform: rotate(180deg);
  background-color: rgba(223, 64, 120, 0.2);
}

/*
============================================
=        Expandable Content                =
============================================
*/
.expandable-content {
  display: block;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    padding 0.35s ease,
    opacity 0.2s ease;
}

.hidden-checkbox:checked ~ .expandable-content {
  max-height: 900px;
  padding: 1rem 2rem 2.5rem;
  opacity: 1;
}

/*
============================================
=        Contributors Grid                 =
============================================
*/
.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.5rem 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--togichu-magenta) rgba(223, 64, 120, 0.1);
}

.contributors-grid::-webkit-scrollbar {
  width: 8px;
}

.contributors-grid::-webkit-scrollbar-track {
  background: rgba(223, 64, 120, 0.05);
  border-radius: 4px;
}

.contributors-grid::-webkit-scrollbar-thumb {
  background-color: var(--togichu-magenta);
  border-radius: 4px;
  border: 2px solid rgba(26, 26, 26, 0.5);
}

.contributors-grid::-webkit-scrollbar-thumb:hover {
  background-color: var(--togichu-pink);
}

.contributor-card {
  position: relative;
  background: linear-gradient(135deg, #1f1f1f 0%, #171717 100%);
  border: 2px solid rgba(223, 64, 120, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  cursor: pointer;
  overflow: hidden;
  transition: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contributor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(223, 64, 120, 0.15) 25%,
    rgba(223, 64, 120, 0.35) 50%,
    rgba(223, 64, 120, 0.5) 75%,
    var(--togichu-pink) 100%
  );
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.contributor-card:hover::before {
  left: 0;
}

.contributor-card::after {
  content: none;
}

.contributor-card:hover {
  border-color: rgba(223, 64, 120, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transform: none;
}

.contributor-card:active {
  transform: none;
}

.contributor-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contributor-name {
  font-family: var(--font-grotesk);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--togichu-peach);
  margin: 0;
  line-height: 1.3;
  transition: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  word-break: break-word;
}

.contributor-card:hover .contributor-name {
  color: white;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.contributor-type {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #32b8c6;
  margin: 0;
  transition: none;
}

/*
============================================
=        Contribution Type Badges          =
============================================
*/
.contributor-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.type-badge::before {
  content: none;
}

.type-subs {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(126, 34, 206, 0.4));
  color: #c4b5fd;
  border: 1px solid rgba(147, 51, 234, 0.5);
}

.contributor-card:hover .type-subs {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(126, 34, 206, 0.6));
  color: #e9d5ff;
  border-color: rgba(147, 51, 234, 0.8);
  box-shadow: 0 0 15px rgba(147, 51, 234, 0.5);
}

.type-bits {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.4));
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.contributor-card:hover .type-bits {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(37, 99, 235, 0.6));
  color: #dbeafe;
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.type-dono {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(22, 163, 74, 0.4));
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.contributor-card:hover .type-dono {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(22, 163, 74, 0.6));
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.event-description {
  font-size: 1.125rem;
  color: #a7a9a9;
  max-width: 800px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

/*
============================================
=            Hidden State                  =
============================================
*/
.hidden {
  display: none !important;
}

.contributor-card.fade-out {
  opacity: 0.2;
  pointer-events: none;
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .history-title {
    font-size: 2.5rem;
  }

  .history-subtitle {
    font-size: 1rem;
  }

  .history-container {
    padding: 1.5rem 1rem;
  }

  .subathon-header {
    padding: 1.25rem 1.5rem;
  }

  .subathon-title {
    font-size: 1.375rem;
  }

  .subathon-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .subathon-separator {
    display: none;
  }

  .contributors-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contributor-card {
    padding: 1.25rem;
  }

  .contributor-name {
    font-size: 1.125rem;
  }

  .type-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.7rem;
  }

  .hidden-checkbox:checked ~ .expandable-content {
    padding: 1rem 1.5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .history-title {
    font-size: 2rem;
  }

  .subathon-header {
    padding: 1rem;
  }

  .subathon-title {
    font-size: 1.25rem;
  }

  .toggle-icon {
    width: 32px;
    height: 32px;
  }

  .contributor-card {
    padding: 1rem;
  }

  .contributor-name {
    font-size: 1rem;
  }
}

/*
============================================
=     Badge Transitions disabled           =
============================================
*/
.type-badge,
.type-badge::before {
  transition: none !important;
}

.type-badge::before {
  content: none !important;
}
