/* ============================================= */
/*          VARIÁVEIS DE COR E ESTILO            */
/* ============================================= */
:root {
  --primary-color: #0d6efd;
  --primary-hover: #0b5ed7;
  --success-color: #198754;
  --danger-color: #dc3545;
  --favorite-color: #e74c3c;
  --bg-color: #f4f6f9;
  --card-bg-color: #ffffff;
  --header-bg-color: #ffffff;
  --text-color: #212529;
  --text-color-light: #6c757d;
  --accent-color: #0056b3;
  --border-color: #dee2e6;
  --border-color-light: #f1f3f5;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-hover-color: rgba(0, 0, 0, 0.15);
  --tag-bg-color: #e7f3ff;
  --tag-text-color: #0056b3;
  --overlay-color: rgba(0, 0, 0, 0.6);
  --sidebar-bg: #1e2a3b;
  --sidebar-text: #adb5bd;
  --sidebar-text-hover: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --gold-color: #ffd700;
  --gold-darker: #E9DFB0;
  --gold-shadow: rgba(255, 215, 0, 0.5);
  --header-height: 60px;
}

html.dark {
  --primary-color: #4dabf7;
  --primary-hover: #74c0fc;
  --success-color: #20c997;
  --danger-color: #ff6b6b;
  --favorite-color: #e74c3c;
  --bg-color: #121212;
  --card-bg-color: #1e1e1e;
  --header-bg-color: #1e1e1e;
  --text-color: #e9ecef;
  --text-color-light: #b0b3b8;
  --accent-color: #4dabf7;
  --border-color: #495057;
  --border-color-light: #2c2e33;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-hover-color: rgba(0, 0, 0, 0.4);
  --tag-bg-color: #3a3b3c;
  --tag-text-color: #e4e6eb;
  --overlay-color: rgba(0, 0, 0, 0.7);
  --sidebar-bg: #1c1f24;
  --sidebar-text: #868e96;
  --gold-shadow: rgba(255, 215, 0, 0.3);
}

/* ============================================= */
/*             ESTILOS GLOBAIS                   */
/* ============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color .3s, color .3s;
}

.form-label {
  text-align: left;
  font-size: 12px;
  margin: 4px 0;
  color: var(--text-color-light);
}

h1,
h2,
h3 {
  text-align: center;
}

/* ============================================= */
/*             CONTEÚDO PRINCIPAL                */
/* ============================================= */
.main-content {
  padding: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .main-content {
    padding: 1.5rem;
  }
}

header h1 {
  font-size: 19px;
  margin-top: 50px; /* ajusta o valor conforme precisar */
}
/* ============================================= */
/*             BANNER DA PÁGINA                  */
/* ============================================= */
.page-banner {
  position: relative;
  padding: 4rem 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-size: cover;
  background-position: center 30%;
  transition: all 0.5s ease;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.page-banner h1,
.page-banner p {
  position: relative;
  z-index: 2;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.share-button {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  background-color: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
}

.share-button:hover {
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* ============================================= */
/*             CONTROLES E FILTROS               */
/* ============================================= */
.controls-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.season-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 400px;
}

.season-dropdown-toggle {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  width: 100%;
  text-align: left;
}

.dropdown-arrow {
  font-size: 1rem;
  color: var(--text-color-light);
  transition: transform 0.3s ease;
  margin-left: auto;
}

.season-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.season-dropdown-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.2);
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  width: 100%;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.season-dropdown.open .season-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.season-dropdown-menu a {
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
}

.season-dropdown-menu a:hover {
  background-color: var(--tag-bg-color);
  color: var(--tag-text-color);
}

.season-dropdown-toggle,
.season-dropdown-menu a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.season-dropdown-toggle img,
.season-dropdown-menu img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.season-dropdown-menu {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.season-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.season-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.season-dropdown-menu::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.season-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-color-light);
}

#seasonDropdownMenu li:not(:last-child) {
  border-bottom: 1.8px solid var(--border-color-light);
}

/* ============================================= */
/*             SEÇÕES DO TORNEIO                 */
/* ============================================= */
.tournament-wrapper {
  display: none;
}

.tournament-wrapper.active {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.group-stage-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 0 auto 3rem auto;
  max-width: 1400px;
}

.group-table-container {
  background-color: var(--card-bg-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-color-light);
}

.group-table-container h3 {
  margin: 0;
  padding: 1rem 1.5rem;
  background-color: var(--tag-bg-color);
  color: var(--tag-text-color);
  font-size: 1.3rem;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

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

.group-table th,
.group-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color-light);
  white-space: nowrap;
}

.group-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color-light);
  text-transform: uppercase;
}

.group-table td {
  font-weight: 500;
  font-size: 0.95rem;
}

.group-table tbody tr:nth-child(-n+2) td:first-child {
  border-left: 3px solid var(--primary-color);
}

.group-table tbody tr:nth-child(odd) {
  background-color: var(--border-color-light);
}

.group-table tr:last-child td {
  border-bottom: none;
}

.group-table th.stat-col,
.group-table td.stat-col {
  text-align: center;
}

.team-name-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-name-cell .team-rank {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color-light);
  width: 20px;
  text-align: center;
}

.form-icons {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.result-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.result-icon.win {
  background-color: var(--success-color);
}

.result-icon.draw {
  background-color: var(--text-color-light);
}

.result-icon.loss {
  background-color: var(--danger-color);
}

.group-matches-title {
  padding: 1rem 1.5rem 0.5rem;
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color-light);
  border-top: 1px solid var(--border-color-light);
}

/* ============================================= */
/*             FASES ELIMINATÓRIAS               */
/* ============================================= */
.round-block {
  margin: 0 auto 2.5rem auto;
  max-width: 900px;
}

.round-title-wrapper {
  text-align: center;
  margin-bottom: 1.5rem;
}

.round-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
}

.match-list-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

.simple-round-list {
  background-color: var(--card-bg-color);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-radius: 12px;
}

.match-container {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color-light);
  transition: background-color 0.2s ease;
}

.match-container:last-child {
  border-bottom: none;
}

.match-container:hover {
  background-color: var(--border-color-light);
}

.match-identifier {
  display: flex;
  align-items: center;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color-light);
  margin-bottom: 0.75rem;
}

.match-identifier::before,
.match-identifier::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.match-identifier span {
  padding: 0 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simple-match {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.team-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  text-align: center;
  transition: opacity 0.3s ease;
}

.team-name {
  font-weight: 500;
  font-size: 1rem;
  white-space: normal;
  word-break: break-word;
}

.match-score {
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--text-color);
  white-space: nowrap;
  line-height: 1.1;
  margin-top: 10px;
}

.vs-separator {
  color: var(--danger-color);
  font-size: 1rem;
  font-weight: bold;
  margin: 0 0.5rem;
}

.match-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 0.75rem;
}

.penalty-score {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1;
}

.penalty-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-color-light);
  border-bottom: 1px solid var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin-top: 5px;
}

.team-crest-container {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.team-crest-container .team-crest {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-info.winner .team-name {
  font-weight: 700;
  color: var(--text-color);
}

.team-info.loser {
  opacity: 0.5;
}

.tbd {
  color: var(--text-color-light);
  font-style: italic;
}

/* ============================================= */
/*                CAMPEÃO                        */
/* ============================================= */
.simple-champion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.5rem;
  color: #000000;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 20px var(--gold-shadow);
  background: radial-gradient(ellipse farthest-corner at right bottom, #FEDB37 0%, #FDB931 8%, #9f7928 30%, #8A6E2F 40%, transparent 80%), radial-gradient(ellipse farthest-corner at left top, #FFFFFF 0%, #FFFFAC 8%, #D1B464 25%, #5d4a1f 62.5%, #5d4a1f 100%);
}

.simple-champion .team-name {
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.simple-champion .team-crest-container {
  width: 150px;
  height: 150px;
}

.simple-champion .team-crest {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.champion-trophy-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================= */
/*             UTILITÁRIOS E ANIMAÇÕES           */
/* ============================================= */
.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 5px solid var(--border-color-light);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  z-index: 9999;
}

@media (min-width: 1024px) {
  .loader {
    left: calc(50% + 140px);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#tournaments-root,
.about-section,
.social-follow-section,
footer {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out;
}

#tournaments-root.visible,
.about-section.visible,
.social-follow-section.visible,
footer.visible {
  opacity: 1;
  visibility: visible;
}

#banner-title,
#banner-description {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlide 1s forwards;
}

#banner-title {
  animation-delay: 0.5s;
}

#banner-description {
  animation-delay: 1.5s;
}

@keyframes fadeSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}