/* === Grom Rating Pages — rating.css === */
/* Design tokens from grom.place variables.scss */

:root {
  --color-dark: #2E2E2E;
  --color-grey: #999999;
  --color-medium-grey: #E1E2E4;
  --color-light-grey: #F3F4F6;
  --color-green: #D6FD52;
  --color-green-hover: rgba(213, 253, 82, 0.35);
  --color-blue: #4176FF;
  --color-white: #FFFFFF;
  --ff: "Montserrat", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ff);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.22;
  color: var(--color-dark);
  background: var(--color-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Layout --- */

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

@media (min-width: 768px) {
  .container { padding: 0 20px; }
}
@media (min-width: 1440px) {
  .container { padding: 0 100px; }
}

/* --- Header --- */

.rating-nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-medium-grey);
  padding: 12px 0;
}

/* --- Navigation Tabs --- */

.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
}

.nav-tabs a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-dark);
  background: var(--color-light-grey);
  transition: background 0.2s, color 0.2s;
}

.nav-tabs a:hover {
  background: var(--color-green-hover);
}

.nav-tabs a.active {
  background: var(--color-green);
  color: var(--color-dark);
  font-weight: 700;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-medium-grey);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--ff);
  font-size: 14px;
  cursor: pointer;
  color: var(--color-dark);
}

@media (max-width: 767px) {
  .nav-toggle { display: block; }
  .nav-tabs {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 12px;
  }
  .nav-tabs.open { display: flex; }
  .nav-tabs a { border-radius: 8px; }
}

/* --- Content --- */

.rating-content {
  padding: 32px 0 64px;
}

.rating-content__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: 8px;
}

.rating-content__subtitle {
  font-size: 14px;
  color: var(--color-grey);
  margin-bottom: 24px;
}

/* --- Filters --- */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--color-medium-grey);
  border-radius: 25px;
  font-family: var(--ff);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--color-green);
}

.search-box input::placeholder {
  color: var(--color-grey);
}

.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-grey);
}

/* Gender / filter pills */
.filter-pills {
  display: flex;
  gap: 4px;
}

.filter-pills button {
  padding: 8px 16px;
  border: 1px solid var(--color-medium-grey);
  border-radius: 25px;
  background: var(--color-white);
  font-family: var(--ff);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-dark);
}

.filter-pills button:hover {
  border-color: var(--color-green);
}

.filter-pills button.active {
  background: var(--color-green);
  border-color: var(--color-green);
  font-weight: 700;
}

/* Select filter */
.filter-select {
  padding: 8px 16px;
  border: 1px solid var(--color-medium-grey);
  border-radius: 25px;
  background: var(--color-white);
  font-family: var(--ff);
  font-size: 14px;
  cursor: pointer;
  color: var(--color-dark);
  outline: none;
}

.filter-select:focus {
  border-color: var(--color-green);
}

/* Counter */
.counter {
  font-size: 14px;
  color: var(--color-grey);
  margin-bottom: 12px;
}

/* --- Table --- */

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th {
  text-align: center;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-medium-grey);
  color: var(--color-grey);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
}

.table-container th.sortable {
  cursor: pointer;
  user-select: none;
}

.table-container th.sortable:hover {
  color: var(--color-dark);
}

.table-container th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.4;
}

.table-container th.sort-asc .sort-arrow,
.table-container th.sort-desc .sort-arrow {
  opacity: 1;
  color: var(--color-dark);
}

.table-container td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-medium-grey);
  text-align: center;
  font-size: 15px;
  white-space: nowrap;
}

/* Fixed-width numeric columns to prevent layout shifts */
.table-container th.num,
.table-container td.num {
  min-width: 68px;
  text-align: center;
}

.table-container th.left,
.table-container td.left {
  text-align: left;
}

.table-container tr:hover td {
  background: var(--color-light-grey);
}

/* Green badge */
.badge {
  display: inline-block;
  background: var(--color-green);
  padding: 4px 12px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 14px;
}

.badge--outline {
  background: transparent;
  border: 1px solid var(--color-green);
  font-weight: 500;
}

/* Score column */
.score {
  font-weight: 700;
  color: var(--color-dark);
}

/* Club name */
.club-name {
  color: var(--color-grey);
}

/* Gender icon */
.gender-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* --- Pagination --- */

.pagination {
  display: flex;
  flex-direction: row;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-medium-grey);
  border-radius: 50%;
  background: var(--color-white);
  font-family: var(--ff);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-dark);
}

.pagination button:hover {
  border-color: var(--color-green);
}

.pagination button.active {
  background: var(--color-green);
  border-color: var(--color-green);
  font-weight: 700;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.pagination .ellipsis {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey);
}

/* --- Footer --- */

.rating-footer {
  border-top: 1px solid var(--color-medium-grey);
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--color-grey);
}

/* --- No results --- */

.no-results {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-grey);
  font-size: 16px;
}

/* --- Responsive --- */

@media (min-width: 768px) {
  .rating-content__title { font-size: 36px; }
  .container { padding: 0 40px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 60px; }
}

@media (min-width: 1440px) {
  .container { max-width: 1440px; padding: 0 100px; }
}

/* --- Detail Modal --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.modal-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-grey);
  padding: 0 4px;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--color-dark);
}

.modal-info {
  font-size: 13px;
  color: var(--color-grey);
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-grey);
  margin-bottom: 8px;
}

/* Event cards */
.ev-card {
  border: 1px solid var(--color-medium-grey);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.ev-card.ev-best {
  border-color: var(--color-green);
  background: rgba(213, 253, 82, 0.08);
}

.ev-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ev-comp {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-dark);
}

.ev-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
  white-space: nowrap;
}

.ev-formula {
  font-size: 12px;
  color: var(--color-grey);
  margin-top: 8px;
  font-style: italic;
}

.ev-params {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-dark);
  margin-top: 6px;
}

.ev-params span {
  background: var(--color-light-grey);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.ev-calc {
  font-size: 13px;
  color: var(--color-dark);
  margin-top: 6px;
  line-height: 1.6;
}

.ev-calc strong {
  color: var(--color-dark);
}

.ev-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  background: var(--color-green);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-calc {
  background: var(--color-light-grey);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.modal-calc-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-calc-divider {
  height: 1px;
  background: var(--color-medium-grey);
  margin: 8px 0;
}

.calc-label {
  color: var(--color-grey);
  min-width: 120px;
}

.modal-calc strong {
  color: var(--color-dark);
}

.table-container tr {
  cursor: pointer;
}

@media (max-width: 767px) {
  .modal-card {
    padding: 20px;
    max-width: 100%;
    border-radius: 12px;
  }
  .modal-name { font-size: 18px; }
  .calc-label { min-width: 100px; }
}

/* === Grom.place Header (from production) === */

.top-bar { background-color: var(--color-dark); }
.top-bar a { font-size: 12px; font-weight: 400; line-height: 14.63px; border-bottom: 1px solid transparent; color: var(--color-white); }
.top-bar a:hover, .top-bar a:focus-visible { border-bottom: 1px solid var(--color-green); }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.top-bar .container div { display: flex; align-items: center; gap: 6px; }
@media (min-width: 768px) {
  .top-bar .container { justify-content: flex-start; gap: 24px; padding-top: 16px; padding-bottom: 16px; }
}

.navbar { background-color: var(--color-white); position: relative; box-shadow: 0 4px 26px 0 rgba(0,0,0,0.08); }
.navbar-wrapper { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; }
@media (min-width: 768px) { .navbar-wrapper { padding: 4px 0; } }

.burger, .grom-logo, .menu, .login { display: inline-block; }

.burger { cursor: pointer; width: 32px; height: 32px; padding: 8px 4px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: none; border: none; }
.burger-line { width: 100%; height: 3px; background-color: var(--color-grey); position: relative; border-radius: 10px; }
.burger-line::before, .burger-line::after { content: ""; position: absolute; width: 100%; height: 3px; background-color: var(--color-grey); border-radius: 10px; }
.burger-line::before { bottom: -7px; }
.burger-line::after { bottom: -14px; }
@media (min-width: 768px) { .burger { display: none; } }

.grom-logo { padding: 0; }
.grom-logo img { width: 70px; height: auto; }
@media (min-width: 768px) { .grom-logo { padding: 8px; } }

.menu { display: none; border-top: 1.5px solid var(--color-medium-grey); background: var(--color-white); }
.menu ul { padding: 18px 0 22px; margin: 0; display: flex; flex-direction: column; gap: 18px; list-style: none; }
.menu li { padding: 4px 0; }
.menu li a { color: var(--color-grey); padding: 0 0 4px; font-size: 14px; font-weight: 400; line-height: 17.07px; border-bottom: 1.5px solid transparent; }
.menu li a:hover { color: var(--color-dark); border-bottom: 1.5px solid var(--color-green); }
.menu.show { display: block; animation: menuOpen 0.8s ease-in-out; position: absolute; top: 100%; left: 0; width: 100%; background-color: rgb(251,251,251); text-align: left; z-index: 99; }
@keyframes menuOpen { 0% { opacity:0; transform:translateY(-100%); } 100% { opacity:1; transform:translateY(0); } }
@media (min-width: 768px) {
  .menu { display: inline-block; border: none; position: relative; background: transparent; text-align: center; width: 70%; }
  .menu ul { flex-direction: row; justify-content: center; gap: 56px; padding: 0; }
  .menu li { display: inline-block; }
  .menu li a { font-size: 14px; font-weight: 400; line-height: 17.07px; color: var(--color-grey); }
  .menu.show { position: relative; background: transparent; }
}

.login a { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; line-height: 19.5px; color: var(--color-dark); background: transparent; cursor: pointer; white-space: nowrap; }
.login a svg { display: block; stroke: var(--color-grey); }
@media (min-width: 768px) {
  .login a { padding: 12px 24px; border-radius: 25px; border: 1.5px solid var(--color-green); }
  .login a svg { display: none; }
  .login a:hover { background-color: var(--color-green); }
}

/* === Grom.place Footer (from production) === */

footer { background: var(--color-dark); padding: 40px 0; }
footer .container { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.footer-wrapper { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; }
.footer-logo { margin-bottom: 8px; }
.footer-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 24px; list-style: none; padding: 0; margin: 0; }
.footer-list a { color: var(--color-white); font-size: 14px; opacity: 0.7; transition: opacity 0.2s; }
.footer-list a:hover { opacity: 1; }
.copyright { color: var(--color-white); font-size: 14px; opacity: 0.5; margin: 0; }

/* === Index page cards === */

.index-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}
@media (min-width: 600px) {
  .index-grid { grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-top: 32px; }
}

.index-card {
  background: #2E2E2E;
  border-radius: 12px;
  padding: 24px;
}
@media (min-width: 600px) {
  .index-card { padding: 32px; }
}

.index-card__title {
  margin: 0 0 8px;
  color: #D6FD52;
  font-size: 20px;
}
@media (min-width: 600px) {
  .index-card__title { font-size: 24px; }
}

.index-card__desc {
  color: #999;
  margin: 0 0 16px;
  font-size: 14px;
}
@media (min-width: 600px) {
  .index-card__desc { margin-bottom: 20px; }
}

.index-card__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.index-card__link {
  display: block;
  padding: 12px 20px;
  background: #3a3a3a;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.index-section {
  margin-top: 32px;
}
@media (min-width: 600px) {
  .index-section { margin-top: 40px; }
}

.index-section__title {
  margin: 0 0 16px;
  color: #2E2E2E;
  font-size: 20px;
}
@media (min-width: 600px) {
  .index-section__title { font-size: 24px; }
}

.index-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 500px) {
  .index-tiles { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .index-tiles { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
}

.index-tile {
  display: block;
  padding: 20px;
  background: #2E2E2E;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  text-align: center;
}

.index-tile__name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}

.index-tile__desc {
  color: #999;
  font-size: 13px;
}

.index-tile--soon {
  opacity: 0.5;
}

.index-tiles--sport {
  margin-top: 24px;
}
