/**
 * RCMMA Fighters Directory Stylesheet
 * Ultra-fast, lightweight, responsive CSS matching official RCMMA styling.
 */

:root {
  --rc-dir-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --rc-dir-black: #0f172a;
  --rc-dir-red: #d20a0a;
  --rc-dir-gray-bg: #f8fafc;
  --rc-dir-border: #e2e8f0;
  --rc-dir-text-sub: #64748b;
  --rc-dir-text-main: #0f172a;
}

.rc-dir-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
  font-family: var(--rc-dir-font);
  color: var(--rc-dir-text-main);
  background: #ffffff;
  box-sizing: border-box;
}

.rc-dir-wrapper * {
  box-sizing: border-box;
}

/* 1. HEADER */
.rc-dir-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.rc-dir-header-left {
  display: flex;
  flex-direction: column;
}

.rc-dir-tag {
  color: var(--rc-dir-red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.rc-dir-title {
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 950;
  line-height: 1.05;
  color: var(--rc-dir-black);
  margin: 0 0 8px 0;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.rc-dir-count-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--rc-dir-text-sub);
}

.rc-dir-count-text strong {
  color: var(--rc-dir-black);
  font-weight: 700;
}

.rc-dir-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.rc-dir-quicklink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-dir-black);
  background: #ffffff;
  border: 1px solid var(--rc-dir-border);
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.rc-dir-quicklink:hover {
  background: var(--rc-dir-gray-bg);
  border-color: var(--rc-dir-black);
  color: var(--rc-dir-red);
}

.rc-dir-arrow {
  font-size: 14px;
  transition: transform 0.18s ease;
}

.rc-dir-quicklink:hover .rc-dir-arrow {
  transform: translateX(3px);
}

/* 2. SEARCH BOX */
.rc-dir-search-container {
  margin-bottom: 20px;
}

.rc-dir-search-box {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1.5px solid var(--rc-dir-border);
  border-radius: 9999px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rc-dir-search-box:focus-within {
  border-color: var(--rc-dir-black);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.rc-dir-search-icon {
  display: flex;
  align-items: center;
  color: var(--rc-dir-text-sub);
  margin-right: 8px;
}

.rc-dir-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--rc-dir-black);
  padding: 8px 4px;
}

.rc-dir-search-input::placeholder {
  color: #94a3b8;
}

.rc-dir-search-clear {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 4px;
  border-radius: 50%;
  transition: color 0.15s;
}

.rc-dir-search-clear:hover {
  color: var(--rc-dir-black);
}

.rc-dir-search-btn {
  border: none;
  background: var(--rc-dir-black);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 8px 20px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.18s ease;
  white-space: nowrap;
}

.rc-dir-search-btn:hover {
  background: var(--rc-dir-red);
}

/* 3. PROMOTION PILLS */
.rc-dir-pills-container {
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}

.rc-dir-pills-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.rc-dir-pills-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  width: max-content;
}

.rc-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--rc-dir-border);
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.rc-dir-pill:hover {
  background: var(--rc-dir-gray-bg);
  border-color: #94a3b8;
  color: var(--rc-dir-black);
}

.rc-dir-pill.is-active {
  background: var(--rc-dir-black);
  border-color: var(--rc-dir-black);
  color: #ffffff;
}

.rc-dir-pill-logo {
  width: 17px;
  height: 17px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffffff;
}

.rc-dir-pill-badge-red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rc-dir-red);
  flex-shrink: 0;
}

.rc-dir-pill.is-active .rc-dir-pill-badge-red {
  background: #ffffff;
}

/* 4. ALPHABET BAR */
.rc-dir-alpha-container {
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rc-dir-alpha-container::-webkit-scrollbar {
  display: none;
}

.rc-dir-alpha-track {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  width: max-content;
}

.rc-dir-alpha-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.rc-dir-alpha-btn:hover {
  background: var(--rc-dir-border);
  color: var(--rc-dir-black);
}

.rc-dir-alpha-btn.is-active {
  background: var(--rc-dir-black);
  color: #ffffff;
}

/* 5. DIVIDER LINE */
.rc-dir-divider {
  width: 100%;
  height: 2px;
  background: var(--rc-dir-black);
  margin-bottom: 24px;
}

/* 6. CONTENT & SECTION */
.rc-dir-content-wrap {
  position: relative;
  min-height: 400px;
}

.rc-dir-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.rc-dir-big-letter {
  font-size: 54px;
  font-weight: 950;
  color: var(--rc-dir-black);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.rc-dir-section-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-dir-text-sub);
}

/* 7. FOUR-COLUMN GRID */
.rc-dir-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 8px;
}

.rc-dir-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
  gap: 10px;
}

.rc-dir-row:hover {
  background: #f1f5f9;
}

.rc-dir-avatar-cell {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.rc-dir-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  display: block;
}

.rc-dir-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.rc-dir-info-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rc-dir-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rc-dir-flag {
  width: 16px;
  height: 11px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.rc-dir-name-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--rc-dir-black);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.rc-dir-name-link:hover {
  color: var(--rc-dir-red);
}

.rc-dir-nickname {
  font-size: 11px;
  font-style: italic;
  color: var(--rc-dir-text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.rc-dir-record-cell {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
}

/* 8. EMPTY STATE */
.rc-dir-empty-state {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--rc-dir-text-sub);
}

.rc-dir-empty-state p {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.rc-dir-reset-btn {
  padding: 8px 20px;
  background: var(--rc-dir-black);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.rc-dir-reset-btn:hover {
  background: var(--rc-dir-red);
}

/* 9. LOADING SPINNER */
.rc-dir-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.rc-dir-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--rc-dir-red);
  border-radius: 50%;
  animation: rc-dir-spin 0.6s linear infinite;
}

@keyframes rc-dir-spin {
  to { transform: rotate(360deg); }
}

/* 10. PAGINATION */
.rc-dir-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rc-dir-border);
  margin-top: 40px;
  padding-top: 20px;
}

.rc-dir-page-nav {
  padding: 8px 18px;
  border: 1px solid var(--rc-dir-border);
  background: #ffffff;
  color: var(--rc-dir-black);
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rc-dir-page-nav:hover:not(:disabled) {
  background: var(--rc-dir-gray-bg);
  border-color: var(--rc-dir-black);
}

.rc-dir-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rc-dir-page-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-dir-text-sub);
}

.rc-dir-page-status span {
  color: var(--rc-dir-black);
  font-weight: 700;
}

/* 11. RESPONSIVENESS */
@media (max-width: 1200px) {
  .rc-dir-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .rc-dir-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rc-dir-header {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 540px) {
  .rc-dir-wrapper {
    padding: 16px 12px 40px 12px;
  }
  .rc-dir-grid {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }
  .rc-dir-big-letter {
    font-size: 40px;
  }
  .rc-dir-search-box {
    max-width: 100%;
  }
  .rc-dir-quicklink {
    font-size: 12px;
    padding: 6px 12px;
  }
}
