/*
============================================
=         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;
}

/*
============================================
=              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: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.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);
}

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

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #a7a9a9;
  font-size: 1.125rem;
  font-family: var(--font-inter);
}

/*
============================================
=          Subathon Card                   =
============================================
*/
.subathon-card {
  position: relative;
  border-radius: 1rem;
  cursor: pointer;
  overflow: visible;
  outline: none;
}

.subathon-card::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-card::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-card:hover::before,
.subathon-card:focus-visible::before {
  opacity: 1;
}

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

.subathon-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  transition: background-color 0.3s ease;
  border-radius: 1rem;
}

.subathon-card:hover .subathon-card-content,
.subathon-card:focus-visible .subathon-card-content {
  background-color: rgba(255, 20, 147, 0.05);
}

.subathon-card-main {
  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;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.draft-badge {
  font-size: 0.875rem;
  color: #32b8c6;
  font-family: var(--font-mono);
  font-weight: 400;
}

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

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

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

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

.subathon-card:hover .card-chevron,
.subathon-card:focus-visible .card-chevron {
  background-color: rgba(223, 64, 120, 0.2);
  transform: translateX(3px);
}

.hidden {
  display: none !important;
}

/*
============================================
=          Modal Overlay                   =
============================================
*/
.subathon-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.subathon-modal-overlay.hidden {
  display: none !important;
}

.subathon-modal {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid rgba(223, 64, 120, 0.3);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(223, 64, 120, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-scroll-container {
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--togichu-magenta) rgba(223, 64, 120, 0.1);
}

.modal-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll-container::-webkit-scrollbar-track {
  background: rgba(223, 64, 120, 0.05);
  border-radius: 3px;
}

.modal-scroll-container::-webkit-scrollbar-thumb {
  background-color: var(--togichu-magenta);
  border-radius: 3px;
}

/*
============================================
=          Modal Header                    =
============================================
*/
.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(223, 64, 120, 0.1);
  border: 1px solid rgba(223, 64, 120, 0.3);
  color: var(--togichu-magenta);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background-color: rgba(223, 64, 120, 0.25);
  border-color: rgba(223, 64, 120, 0.6);
}

.modal-header {
  margin-bottom: 2rem;
  padding-right: 3rem;
}

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

/*
============================================
=          Modal Stats Grid                =
============================================
*/
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(223, 64, 120, 0.15);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(223, 64, 120, 0.7);
}

.stat-value {
  font-family: var(--font-grotesk);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--togichu-peach);
  line-height: 1.2;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a7a9a9;
}

/*
============================================
=     Modal Contributors Section           =
============================================
*/
.modal-contributors-section {
  border-top: 1px solid rgba(223, 64, 120, 0.15);
  padding-top: 1.75rem;
}

.modal-search-wrapper {
  margin-bottom: 1.5rem;
}

.modal-search {
  max-width: 100%;
}

/*
============================================
=        Contributors Grid                 =
============================================
*/
.contributors-grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.25rem 0;
}

.contributor-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(223, 64, 120, 0.15);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contributor-card:hover {
  background: rgba(223, 64, 120, 0.06);
  border-color: rgba(223, 64, 120, 0.35);
}

.contributor-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.contributor-name {
  font-family: var(--font-grotesk);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--togichu-peach);
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

/*
============================================
=        Search Highlight                  =
============================================
*/
.contributor-card.highlight-match {
  border-color: var(--togichu-magenta);
  background: rgba(223, 64, 120, 0.08);
}

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

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  transition: none !important;
}

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

.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);
}


.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);
}


.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);
}


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

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

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

  .subathon-card-content {
    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;
  }

  .modal-stats-grid {
    grid-template-columns: 1fr;
  }

  .subathon-modal {
    padding: 2rem 1.5rem;
    max-height: 95vh;
  }

  .modal-event-title {
    font-size: 1.75rem;
  }

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

  .contributor-card {
    padding: 1rem;
    min-height: 80px;
  }

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

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

  .subathon-card-content {
    padding: 1rem;
  }

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

  .card-chevron {
    width: 32px;
    height: 32px;
  }

  .subathon-modal {
    padding: 1.5rem 1rem;
  }

  .modal-event-title {
    font-size: 1.5rem;
  }

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

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

  .type-badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
  }
}
