/**
 * GS Theme for Geo Ranking Tables
 * GamblingSite.com style - replicates ftm-td homepage table design
 */

/* CSS Variables */
.grt-theme-gs-theme {
  --table-bg-color: #000000;
  --table-txt-color: #ffffff;
  --how-bg-color: #279624;
  --how-txt-color: #6bbc34;
  --how-icon-color: #ffffff;
  --tab-bg-color: #215791;
  --tab-txt-color: #ffffff;
  --tab-bg-color-hover: #2c70ba;
  --current-tab-bg-color: #ffffff;
  --current-tab-txt-color: #15365a;
  --see-bg-color: #6bbc34;
  --see-txt-color: #ffffff;
  --see-bg-hv-color: #95d8a1;
  --see-txt-color-hover: #0a0a0a;
  --first-bg-color: #6bbc34;
  --first-txt-color: #112c4a;
  --rank-bg-color: #a8a8a8;
  --rank-txt-color: #ffffff;
  --records-bg-color: #d3d3d3;
  --visit-bg-color: #fdcd1a;
  --visit-txt-color: #000000;
  --visit-bg-border-color: #d6ae17;
  --visit-bg-color-hover: #e35639;
  --visit-bg-border-color-hover: #e35639;
  --visit-txt-color-hover: #ffffff;
  --pros-icon-color: #81d742;
  --cons-icon-color: #ff2e04;
}

/* Main Wrapper */
.grt-theme-gs-theme {
  background-color: var(--table-bg-color);
  border-radius: 8px;
  overflow: visible; /* Allow tooltips to display outside wrapper */
}

/* Header */
.grt-theme-gs-theme .gs-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.5em 1em;
}

.grt-theme-gs-theme .gs-how-rate {
  display: flex;
  align-items: center;
}

.grt-theme-gs-theme .gs-how-text {
  color: var(--how-txt-color);
  font-size: 1.25em;
  font-weight: 700;
  margin-right: 1em;
}

.grt-theme-gs-theme .gs-trust-factor {
  background-color: var(--how-bg-color);
  border-radius: 3px;
  height: 2.3em;
  width: 2.3em;
  display: grid;
  place-items: center;
  margin-left: 0.5em;
  cursor: pointer;
  position: relative;
}

/* Tooltip - hidden by default */
.grt-theme-gs-theme .gs-trust-factor p {
  display: none;
  margin: 0;
}

/* Icon styling - use simple Unicode symbols that respect CSS color */
.grt-theme-gs-theme .gs-trust-factor::before {
  color: var(--how-icon-color);
  font-size: 1.2em;
  line-height: 1;
}

/* Icon: Shield (Safety & Security) - cross on shield */
.grt-theme-gs-theme .gs-icon-shield::before {
  content: "\26E8";
  font-size: 1.7em;
  position: relative;
  top: -1px;
}

/* Icon: Gauge (Payout Speed) - using play triangle */
.grt-theme-gs-theme .gs-icon-gauge::before {
  content: "\25B6";
}

/* Icon: Star (Features) */
.grt-theme-gs-theme .gs-icon-star::before {
  content: "\2605";
}

/* Icon: Dollar (Bonuses) */
.grt-theme-gs-theme .gs-icon-dollar::before {
  content: "$";
  font-weight: bold;
}

/* Body Wrapper */
.grt-theme-gs-theme .gs-body-wrapper {
  /* Container for tab header and sites */
}

/* Tab Header */
.grt-theme-gs-theme .gs-body-header {
  display: flex;
  gap: 0.5em;
  padding: 0 1em;
}

.grt-theme-gs-theme .gs-tab {
  background-color: var(--tab-bg-color);
  border-radius: 5px 5px 0 0;
  color: var(--tab-txt-color);
  cursor: pointer;
  font-size: 0.875em;
  font-weight: 700;
  padding: 1em;
  text-align: center;
  text-transform: uppercase;
}

.grt-theme-gs-theme .gs-tab.active {
  background-color: var(--current-tab-bg-color);
  color: var(--current-tab-txt-color);
}

/* Sites Container */
.grt-theme-gs-theme .gs-sites-container {
  background-color: var(--current-tab-bg-color);
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  padding: 1em;
  border-left: 3px solid var(--table-bg-color);
  border-right: 3px solid var(--table-bg-color);
  border-bottom: 3px solid var(--table-bg-color);
}

/* Also style the grt-sites-table which wraps the site cards */
.grt-theme-gs-theme .grt-sites-table {
  background-color: transparent;
}

/* Site Card */
.grt-theme-gs-theme .gs-site {
  background-color: #fff;
  border: 3px solid var(--records-bg-color);
  color: #333;
  display: grid;
  font-size: 1rem;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  position: relative;
}

.grt-theme-gs-theme .gs-site:not(:first-child) {
  margin-top: 1rem;
}

/* First Site Card - Green border */
.grt-theme-gs-theme .gs-site.gs-site-first {
  border-color: var(--first-bg-color);
}

.grt-theme-gs-theme .gs-site.gs-site-first .gs-site-rank {
  background-color: var(--first-bg-color);
  color: var(--first-txt-color);
}

/* Full card clickable overlay */
.grt-theme-gs-theme .gs-site-overlay {
  height: 100%;
  position: absolute;
  width: 100%;
  z-index: 10;
}

/* Rank Badge */
.grt-theme-gs-theme .gs-site-rank {
  font-size: 1.1em;
  height: 2em;
  width: 2em;
  background-color: var(--rank-bg-color);
  color: var(--rank-txt-color);
  display: grid;
  font-weight: 700;
  left: -3px;
  place-content: center;
  place-items: center;
  position: absolute;
  top: -3px;
}

/* Logo */
.grt-theme-gs-theme .gs-site-logo {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1em 0.5em;
}

.grt-theme-gs-theme .gs-site-logo img {
  height: 5em;
  object-fit: contain;
  width: 100%;
}

.grt-theme-gs-theme .gs-site-logo .grt-site-initial {
  width: 70px;
  height: 70px;
  font-size: 1.8em;
  background: #f0f0f0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: bold;
}

/* Bonus Section */
.grt-theme-gs-theme .gs-site-bonus {
  display: grid;
  font-weight: 700;
  place-content: center;
  place-items: center;
  text-align: center;
}

.grt-theme-gs-theme .gs-site-bonus p {
  line-height: 1.1;
  margin: 0;
  font-size: 1.875em;
}

.grt-theme-gs-theme .gs-site-bonus p:first-child {
  text-transform: uppercase;
  font-size: 1em;
}

/* Rating Section */
.grt-theme-gs-theme .gs-site-rating {
  gap: 0.5em;
  border-top: 1px solid #d6d6d6;
  display: grid;
  padding: 1em;
  place-content: center;
  place-items: center;
  text-align: center;
}

.grt-theme-gs-theme .gs-rating-image img {
  max-width: 110px;
  height: auto;
}

/* Star Rating - Unicode Stars with Percentage Overlay */
.grt-theme-gs-theme .gs-rating-stars {
  display: inline-block;
  position: relative;
  font-size: 20px;
  line-height: 1;
}

.grt-theme-gs-theme .gs-star-over,
.grt-theme-gs-theme .gs-star-under {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 2px;
}

.grt-theme-gs-theme .gs-star-under {
  color: #ddd;
}

.grt-theme-gs-theme .gs-star-under::before {
  content: "\2605\2605\2605\2605\2605";
}

.grt-theme-gs-theme .gs-star-over {
  color: #ffc107;
  position: absolute;
  top: 0;
  left: 0;
}

.grt-theme-gs-theme .gs-star-over::before {
  content: "\2605\2605\2605\2605\2605";
}

/* Link Wrapper */
.grt-theme-gs-theme .gs-site-links {
  gap: 1em;
  border-top: 1px solid #d6d6d6;
  display: grid;
  padding: 1em;
  place-content: center stretch;
  place-items: center;
  text-align: center;
  border-bottom: 1px solid #d6d6d6;
}

.grt-theme-gs-theme .gs-visit-btn {
  color: var(--visit-txt-color);
  background-color: var(--visit-bg-color);
  border-bottom: 3px solid var(--visit-bg-border-color);
  border-radius: 10px;
  display: block;
  font-size: 1.125em;
  font-weight: 700;
  padding: 0.75em;
  text-align: center;
  text-decoration: none;
  width: 100%;
  z-index: 15;
  position: relative;
}

.grt-theme-gs-theme .gs-visit-btn:hover {
  background: var(--visit-bg-color-hover);
  border-bottom-color: var(--visit-bg-border-color-hover);
  color: var(--visit-txt-color-hover);
  text-decoration: none;
}

.grt-theme-gs-theme .gs-review-link {
  color: #15365a;
  font-size: 0.75em;
  font-weight: 500;
  position: relative;
  text-align: center;
  text-decoration: underline;
  text-transform: uppercase;
  z-index: 15;
}

.grt-theme-gs-theme .gs-review-link:hover {
  text-decoration: none;
}

/* Pros Section */
.grt-theme-gs-theme .gs-site-pros {
  border-top: 1px solid #d6d6d6;
  grid-column: span 2;
  padding: 1em 0.5em;
  font-size: 0.875em;
}

.grt-theme-gs-theme .gs-pro-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.grt-theme-gs-theme .gs-pro-list li {
  line-height: 1.6em;
  padding: 0.1em 0 0.1em 1.5em;
  position: relative;
}

.grt-theme-gs-theme .gs-pro-list li::before {
  content: "\2713";
  color: var(--pros-icon-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Cons Section */
.grt-theme-gs-theme .gs-site-cons {
  font-size: 0.875em;
  grid-column: span 2;
  padding: 1em 0.5em;
}

.grt-theme-gs-theme .gs-con-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.grt-theme-gs-theme .gs-con-list li {
  line-height: 1.6em;
  padding: 0.1em 0 0.1em 1.5em;
  position: relative;
}

.grt-theme-gs-theme .gs-con-list li::before {
  content: "\2717";
  color: var(--cons-icon-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Key Facts Section */
.grt-theme-gs-theme .gs-site-keyfacts {
  gap: 0.5em 2em;
  align-content: center;
  border-top: 1px solid #d6d6d6;
  display: grid;
  grid-column: span 2;
  grid-template-columns: 1fr;
  padding: 1em;
  border-bottom: 1px solid #d6d6d6;
}

.grt-theme-gs-theme .gs-site-keyfacts > p {
  font-weight: bold;
  text-align: center;
  margin: 0;
}

.grt-theme-gs-theme .gs-site-keyfacts p {
  color: #333;
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
  margin: 0;
}

.grt-theme-gs-theme .gs-keyfacts-details {
  font-size: 1em;
}

/* Footer */
.grt-theme-gs-theme .gs-footer a {
  margin-top: 10px;
  background-color: var(--see-bg-color);
  color: var(--see-txt-color);
  display: block;
  font-size: 0.875em;
  font-weight: 700;
  padding: 0.5em;
  text-align: center;
  text-decoration: none;
}

.grt-theme-gs-theme .gs-footer a:hover {
  background-color: var(--see-bg-hv-color);
  color: var(--see-txt-color-hover);
  text-decoration: none;
}

/* ===== RESPONSIVE - Desktop (768px+) ===== */
@media (min-width: 768px) {
  .grt-theme-gs-theme .gs-site-rank {
    font-size: 1.5em;
    height: 2em;
    width: 2em;
  }

  .grt-theme-gs-theme .gs-site {
    grid-template-columns: 20% 1fr 5% 1fr 20%;
  }

  .grt-theme-gs-theme .gs-site-bonus {
    border-left: 1px solid #d6d6d6;
    border-top: 1px solid #d6d6d6;
    grid-area: 2 / 3 / auto / span 2;
    padding: 1em 2em;
    border-bottom: 1px solid #d6d6d6;
  }

  .grt-theme-gs-theme .gs-site-rating {
    border-left: 1px solid #d6d6d6;
    border-top: none;
    grid-column: 5;
  }

  .grt-theme-gs-theme .gs-site-links {
    border-left: 1px solid #d6d6d6;
    border-top: none;
    grid-column: 5;
  }

  .grt-theme-gs-theme .gs-site-pros {
    border-top: none;
    grid-column: 2 / span 2;
    padding: 1em 0.5em;
  }

  .grt-theme-gs-theme .gs-site-cons {
    grid-column: 4;
    padding: 1em 0.5em;
  }

  .grt-theme-gs-theme .gs-site-keyfacts {
    grid-column: span 2;
    grid-template-columns: fit-content(50%) 1fr;
  }

  /* Tooltip - show on hover (desktop only) */
  .grt-theme-gs-theme .gs-trust-factor p {
    position: absolute;
    bottom: calc(100% + 1em);
    right: 0;
    width: 25em;
    max-width: 350px;
    padding: 0.75em;
    background-color: var(--current-tab-bg-color);
    color: #333;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    z-index: 999;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .grt-theme-gs-theme .gs-trust-factor p span {
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    margin-bottom: 0.3em;
    color: #000;
  }

  .grt-theme-gs-theme .gs-trust-factor:hover p {
    display: block;
  }

  /* Triangle arrow pointing down */
  .grt-theme-gs-theme .gs-trust-factor::after {
    content: "";
    display: none;
    position: absolute;
    bottom: calc(100% + 0.2em);
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--current-tab-bg-color);
    z-index: 1000;
  }

  .grt-theme-gs-theme .gs-trust-factor:hover::after {
    display: block;
  }
}

/* Disclaimer Section */
.grt-theme-gs-theme .grt-site-disclaimer {
  grid-column: span 5;
  padding: 1em;
  margin-top: 0;
  text-align: center;
}

.grt-theme-gs-theme .grt-disclaimer-toggle {
  color: var(--how-txt-color);
  position: relative;
  z-index: 15;
}

.grt-theme-gs-theme .grt-disclaimer-toggle:hover {
  color: var(--first-bg-color);
}

.grt-theme-gs-theme .grt-disclaimer-content {
  text-align: left;
  background: #f5f5f5;
  margin-top: 1em;
}

/* ===== RESPONSIVE - Mobile (below 768px) ===== */
@media (max-width: 767px) {
  .grt-theme-gs-theme .gs-how-rate {
    display: none;
  }

  .grt-theme-gs-theme .gs-header {
    display: none;
  }

  .grt-theme-gs-theme .gs-trust-factor i::before {
    font-size: 2em;
  }

  /* Disclaimer - ensure full width on mobile */
  .grt-theme-gs-theme .grt-site-disclaimer {
    grid-column: span 2;
  }
}
