/*
  ============================================
  =              Commands Page               =
  ============================================
  */
.commands-title,
.commands-subtitle,
.commands-intro,
.commands-filters,
.command-card {
  opacity: 0;
}

.commands-hero {
  max-width: 1280px;
  margin: 0 auto 4rem;
  padding: 2rem 1.5rem;
}

.commands-header {
  text-align: center;
  margin-bottom: 3rem;
}

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

.commands-subtitle {
  font-family: var(--font-grotesk);
  font-size: 1.375rem;
  color: #32b8c6;
  font-weight: 500;
  margin: 0;
}

/*
============================================
=              Filter Section              =
============================================
*/
.commands-filters {
  background-color: #262828;
  border: 1px solid rgba(223, 64, 120, 0.3);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-label {
  font-family: var(--font-grotesk);
  font-size: 1.25rem;
  font-weight: 600;
  color: #f5f5f5;
  margin: 0;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 2px solid rgba(50, 184, 198, 0.4);
  background-color: transparent;
  color: #a7a9a9;
  font-family: var(--font-inter);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 500;
}

.filter-button:hover:not(.active) {
  border-color: #32b8c6;
  color: #32b8c6;
  background-color: rgba(50, 184, 198, 0.1);
}

.filter-button.active {
  background-color: #32b8c6;
  border-color: #32b8c6;
  color: var(--togichu-black);
  font-weight: 600;
}

.filter-button.active:hover {
  background-color: #32b8c6;
  border-color: #32b8c6;
  color: var(--togichu-black);
}

/*
============================================
=              Commands Grid               =
============================================
*/
.commands-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.command-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(223, 64, 120, 0.3);
  background-color: #262828;
  padding: 1.5rem;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.command-card:hover {
  border-color: #32b8c6;
  box-shadow: 0 8px 24px rgba(50, 184, 198, 0.15);
  transform: translateY(-4px);
}

.command-card.hidden {
  display: none;
}

.command-card.hidden-fade {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: none;
}

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.command-name {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--togichu-magenta);
  margin: 0;
  word-break: break-word;
  flex: 1 1 auto;
}

.command-prefix {
  letter-spacing: 0.15em;
  font-family: var(--font-grotesk);
  color: var(--togichu-magenta);
}

.command-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.command-tags-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/*
============================================
=              Category Tags               =
============================================
*/
.tag.category {
  background-color: rgba(50, 184, 198, 0.2);
  color: #32b8c6;
  border: 1px solid rgba(50, 184, 198, 0.4);
}

.tag.category.game {
  background-color: rgba(232, 212, 184, 0.2);
  color: #e8d4b8;
  border-color: rgba(232, 212, 184, 0.4);
}

.tag.category.announcements {
  background-color: rgba(255, 84, 89, 0.2);
  color: #ff5459;
  border-color: rgba(255, 84, 89, 0.4);
}

.tag.category.socials {
  background-color: rgba(147, 112, 219, 0.2);
  color: #9370db;
  border-color: rgba(147, 112, 219, 0.4);
}

.tag.category.curation {
  background-color: rgba(255, 165, 0, 0.2);
  color: #ffa500;
  border-color: rgba(255, 165, 0, 0.4);
}

.tag.category.utility {
  background-color: rgba(100, 200, 100, 0.2);
  color: #64c864;
  border-color: rgba(100, 200, 100, 0.4);
}

.tag.category.info {
  background-color: rgba(50, 184, 198, 0.2);
  color: #32b8c6;
  border-color: rgba(50, 184, 198, 0.4);
}

/*
============================================
=             Permission Tags              =
============================================
*/
.tag.permission {
  background-color: rgba(50, 184, 198, 0.2);
  color: #32b8c6;
  border: 1px solid rgba(50, 184, 198, 0.4);
}

.tag.permission.subscriber {
  background-color: rgba(226, 42, 156, 0.2);
  color: #e22a9c;
  border-color: rgba(226, 42, 156, 0.4);
}

.tag.permission.moderator {
  background-color: rgba(255, 84, 89, 0.2);
  color: #ff5459;
  border-color: rgba(255, 84, 89, 0.4);
}

/*
============================================
=               Cooldown Tag               =
============================================
*/
.command-meta {
  margin-top: 0.25rem;
}

.tag.cooldown {
  background-color: rgba(255, 152, 0, 0.2);
  color: #ffb74d;
  border: 1px solid rgba(255, 152, 0, 0.5);
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

/*
============================================
=           Description & Usage            =
============================================
*/
.command-description {
  color: #a7a9a9;
  font-size: 0.9375rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  min-height: 2.5rem;
}

.command-usage {
  background-color: rgba(50, 184, 198, 0.1);
  border-left: 3px solid #32b8c6;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  margin-bottom: 0.25rem;
}

.command-usage-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #32b8c6;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.usage-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(50, 184, 198, 0.7);
  color: #32b8c6;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
}

.usage-tooltip {
  position: absolute;
  left: -6px;
  bottom: 130%;
  transform: translateX(0);
  background: #151616;
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(50, 184, 198, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  white-space: nowrap;
  z-index: 20;
}

.usage-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 6px;
  transform: translateX(0);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(50, 184, 198, 0.5) transparent transparent transparent;
}

.usage-help:hover .usage-tooltip,
.usage-help:focus-within .usage-tooltip {
  opacity: 1;
  transform: translateY(-2px);
}

.usage-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.usage-tooltip-row:first-child {
  margin-bottom: 0.25rem;
}

.legend-token {
  font-family: var(--font-mono);
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
}

.legend-required {
  background: rgba(255, 84, 89, 0.12);
  border: 1px solid rgba(255, 84, 89, 0.4);
  color: #ff5459;
}

.legend-optional {
  background: rgba(50, 184, 198, 0.12);
  border: 1px solid rgba(50, 184, 198, 0.4);
  color: #32b8c6;
}

.legend-text {
  color: #a7a9a9;
}

.command-usage-code {
  font-family: var(--font-mono);
  color: #f5f5f5;
  font-size: 0.875rem;
}

/*
============================================
=                 Aliases                  =
============================================
*/
.command-aliases {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(223, 64, 120, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.command-aliases-label {
  font-weight: 600;
  color: #32b8c6;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.aliases-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.alias-badge {
  background: #2f3131;
  color: #f5f5f5;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(50, 184, 198, 0.4);
  cursor: help;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.alias-badge:hover {
  background: #343636;
  border-color: #32b8c6;
}

/*
============================================
=               Empty State                =
============================================
*/
.no-commands {
  text-align: center;
  padding: 3rem 2rem;
  color: #a7a9a9;
}

.no-commands-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-commands-text {
  font-size: 1.125rem;
  margin: 0;
  line-height: 1.6;
}

/*
============================================
=            Responsive Design             =
============================================
*/
@media (max-width: 1024px) {
  .commands-title {
    font-size: 3.5rem;
  }

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

  .commands-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 640px) {
  .commands-title {
    font-size: 2.7rem;
  }

  .commands-subtitle {
    font-size: 1.125rem;
  }

  .commands-filters {
    padding: 1.5rem;
  }

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

  .command-header {
    flex-direction: column;
  }

  .command-tags {
    justify-content: flex-start;
    width: 100%;
  }

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

  .command-card {
    padding: 1rem;
  }

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

  .tag {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .alias-badge {
    font-size: 0.75rem;
  }
}
