/* ========================================================================== */
/*                               COMPETITION HEADER                           */
/* ========================================================================== */

.competition-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  border-left: 3px solid #34d399;
}

.comp-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comp-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.comp-info h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: white;
  margin: 0;
}

/* ========================================================================== */
/*                                   TABS                                     */
/* ========================================================================== */

/* Carousel horizontal pour onglets */
.advanced-tabs {
  display: flex;
  gap: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.advanced-tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 1rem 0.5rem;
  color: #9ca3af;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-item:hover {
  color: white;
}

.tab-item.active {
  color: #34d399;
  border-bottom-color: #34d399;
}

.hidden {
  display: none;
}

/* ========================================================================== */
/*                            SEASON SELECT NAV                               */
/* ========================================================================== */

#season-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

/* Desktop select */
#season-nav .desktop select {
  height: 2.5rem !important;
  line-height: 2.5rem !important;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 1rem;
  box-sizing: border-box;
  border-radius: 9999px;
  color: #cbd5e1;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  appearance: none;
  text-align: center;
  min-width: 6rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#season-nav .desktop select option {
  background-color: #2d3748;
  color: #fff;
}

#season-nav .desktop select option:hover {
  background-color: #4a5568;
}

/* Mobile select */
#season-nav .mobile {
  display: none;
}

#season-nav .mobile select {
  height: 2rem !important;
  line-height: 2rem !important;
  font-size: 0.75rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
  border-radius: 9999px;
  color: #fff;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  appearance: none;
  text-align: center;
  min-width: 5rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#season-nav .mobile select option {
  background-color: #2d3748;
  color: #fff;
}

#season-nav .mobile select option:hover {
  background-color: #4a5568;
}

/* ========================================================================== */
/*                             GRID LAYOUT 65/35                               */
/* ========================================================================== */

.page-container.competition-grid-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}

main#main-view-container {
  flex: 1 1 0;
  min-width: 0; /* important pour éviter le débordement */
}

aside {
  flex: 0 0 40%;
  min-width: 250px;
}

/* Sticky sidebar */
.sidebar-sticky {
  position: sticky;
  top: 2rem;
  width: 100%;
  max-width: 100%;
}

/* Par défaut (tous les onglets sauf General) */
.page-container.competition-grid-layout {
  display: block; /* Full width */
}

/* Layout flex seulement pour General */
body.grid-active .page-container.competition-grid-layout {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}

body.grid-active main#main-view-container {
  flex: 1 1 0;
  min-width: 0; /* important pour éviter le débordement */
}

body.grid-active aside {
  flex: 0 0 40%;
  min-width: 250px;
  display: block;
}

/* ========================================================================== */
/*                                VIEW TOGGLES                                */
/* ========================================================================== */

.toggle-season-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

#toggle-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  width: auto;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  padding: 0.25rem;
  backdrop-filter: blur(12px);
}

/* ========================================================================== */
/*                             ROUND / FIXTURES                               */
/* ========================================================================== */

#round-toolbar button {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-weight: 600;
  transition: all 0.25s ease;
}

#round-toolbar button:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

#round-toolbar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#round-title {
  font-weight: 700;
  color: var(--color-green);
}

/* ========================================================================== */
/*                                  MOBILE                                    */
/* ========================================================================== */

@media (max-width: 1023px) {

  .page-container.competition-grid-layout {
    display: block;
  }

  aside {
    display: none;
  }

  main#main-view-container {
    width: 100%;
    min-width: 0;
  }

}

@media (max-width: 640px) {

  .comp-header-top {
    flex-direction: column;
    align-items: flex-start;      
    justify-content: flex-start;  
    text-align: left;
    gap: 0.5rem;                  
  }

  /* Bloc logo + titre */
  .comp-header-top > div:first-child {
    display: flex;
    align-items: center;
    justify-content: flex-start;  
    width: 100%;
    gap: 1rem; 
  }

  .comp-info h1 {
    font-size: 1.25rem;
    font-weight: 500;
    color: white;
    margin: 0;
  }

  #season-nav {
    width: 100%;
    justify-content: flex-start;  
    margin-top: 0.25rem;
  }

  #season-nav .desktop {
    display: none;
  }

  #season-nav .mobile {
    display: block;
  }

  .advanced-tabs {
    gap: 1rem;
    justify-content: flex-start;  
  }

  .toggle-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  #toggle-group {
    gap: 0.125rem;
  }
}