/* === Base Styles === */
* {
  font-family: 'Ysabeau', Helvetica, Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 900;
}

pre {
  font-family: inherit;
  font-size: var(--bs-body-font-size);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.nav-link {
  font-size: large;
  font-weight: 600;
  color: white;
}

.nav-link:hover,
.nav-link:focus,
.btn.show {
  color: white;
}

.navbar {
  --bs-navbar-padding-y: 0.3rem;
}

figure {
  margin: 0;
}

.img-preview {
  width: 100%;
  height: 50vw;
  object-fit: cover;
}

.item-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.top-section {
  height: 12vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bottom-content {
  display: inline-block;
}

.bi {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.CodeMirror.cm-s-paper,
.tagify__input,
.editor-toolbar a.fa {
  color: currentColor !important;
  background: none;
}

/* === Layout === */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.game-and-players {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  width: 100%;
}

.right-panel-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 35%;
  min-width: 0;
}

/* === Cards === */
.card.shiny {
  position: relative;
  overflow: hidden;
}

.card.shiny::before {
  content: "";
  position: absolute;
  top: -100%;
  left: -100%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  transform: rotate(25deg);
  transition: transform 0.5s ease-in-out;
}

.card.shiny:hover::before {
  transform: rotate(25deg) translate(100%, 100%);
}

.game-card:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* === Game Details === */
.game-details-card {
  display: flex;
  flex-direction: row;
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  flex: 1 1 60%;
  min-width: 0;
}

.game-image {
  width: 300px;
  object-fit: cover;
  flex-shrink: 0;
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  justify-content: space-between;
}

.info-top {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-wrap: anywhere;
}

.top-info h1 {
  margin-bottom: 0.25rem;
  font-size: 1.8rem;
}

.top-info .badges {
  margin-left: 0.5rem;
}

.top-info .meta {
  font-size: 0.9rem;
  color: #555;
}

.description-section p {
  margin: 0.3rem 0 0;
}

.additional-info {
  font-size: 0.9rem;
  color: #666;
}

.info-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bottom-subsection {
  display: flex;
  gap: 1.5rem;
}

.bottom-subsection .restrictions,
.bottom-subsection .ambience {
  flex: 1;
}

.bottom-subsection .restrictions {
  border-left: none;
  border-right: none;
  padding: 0;
}

.classification-columns {
  display: flex;
  gap: 1rem;
}

.classification-columns .column,
.classification,
.restrictions,
.ambience {
  flex: 1;
}

.classification .progress {
  height: 6px;
  margin-top: 0.3rem;
}

.ambience .badge {
  margin: 0 0.3rem 0.3rem 0;
}

.restrictions {
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
  padding: 0 1rem;
}

/* === Player Panel === */
.player-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.player-list-card {
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.07);
}

.player-list-card .card-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--bs-light);
}

.player-list-card .card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
}

.player {
  flex: 1 1 calc(40% - 0.75rem);
  text-align: center;
  font-size: 0.8rem;
}

.player img,
.player .empty-seat {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 0.25rem;
  object-fit: cover;
  background: var(--bs-light);
}

.empty-seat {
  background: var(--bs-light);
  opacity: 0.4;
}

.badge-dynamic {
  background-color: var(--bs-dark);
  color: var(--bs-light);
}

.badge-dynamic-inv {
  background-color: var(--bs-dark);
  color: var(--bs-light);
}

/* === Buttons and Actions === */
.signup-btn {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.375rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#actionsPanel {
  margin-top: 0px !important;
}

/* === Sessions List === */
.sessions-list {
  margin-top: 2.5rem;
}

.sessions-list h3 {
  margin-bottom: 1rem;
}

.sessions-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.session-card {
  background: white;
  padding: 1rem;
  border-radius: 0.375rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.07);
  min-width: 220px;
  flex: 1 1 220px;
}

.session-card .btn-group button {
  min-width: 35px;
}

/* === FullCalendar Customization === */
.fc-event {
  white-space: normal !important;
  line-height: 1.2em;
  padding: 2px;
}

.fc-event-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial;
}

.fc-daygrid-event {
  font-size: 0.85em;
  padding: 2px 4px;
}

.fc-event.event-oneshot {
  color: #75b798 !important;
}

.fc-event.event-campaign {
  color: #0d6efd !important;
}

.fc .fc-button {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  text-transform: none;
}

.fc .fc-button-active,
.fc .fc-button:active {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.fc .fc-button:disabled {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  opacity: 0.65;
  pointer-events: none;
}

.fc .fc-button:hover {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  filter: brightness(95%);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: #86b7fe;
  border-color: #0d6efd;
  color: var(--fc-button-text-color);
}

/* === Select2 === */
.select2-container {
  width: 100% !important;
}

/* === Misc === */
.session-box {
  max-height: 15em;
}

.calendar-wrapper {
  display: inline-block;
  text-align: center;
}

.calendar-btn-group {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  overflow-x: auto;
}

.session-card add-to-calendar-button {
  display: block;
  margin-bottom: 0.25rem;
}

.introjs-tooltip {
  min-width: 350px !important;
  max-width: 500px !important;
}

/* === Responsive === */
@media (min-width: 500px) {
  .img-preview {
    height: 15vw;
  }
}

@media (max-width: 991.98px) {
  .game-and-players {
    flex-direction: column;
  }

  .game-details-card,
  .right-panel-wrapper {
    flex: 1 1 100%;
  }

  .player {
    flex: 1 1 40%;
  }

  .game-image {
    width: 100%;
    height: auto;
    border-radius: 0.375rem 0.375rem 0 0;
  }

  .game-details-card {
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .player {
    flex: 1 1 40%;
  }
}

@media (max-width: 767.98px) {

  /* smaller fonts inside events */
  .fc .fc-event,
  .fc .fc-daygrid-event {
    font-size: 0.75rem;
    padding: 1px 2px;
  }

  /* shrink the day numbers */
  .fc .fc-daygrid-day-number {
    font-size: 0.85rem;
  }

  /* allow horizontal scroll if grid overflows */
  #month-games-calendar .fc-daygrid {
    overflow-x: auto;
  }

  /* reduce header button padding */
  .fc .fc-toolbar-chunk button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* === Dark Theme === */
[data-bs-theme="dark"] {

  .game-details-card,
  .player-list-card,
  .session-card {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
  }

  .card-header {
    background-color: #2a2a2a;
    color: var(--bs-light);
    border-bottom-color: #444;
  }

  .player img,
  .player .empty-seat {
    background-color: #444;
  }

  .badge-dynamic {
    background-color: var(--bs-light);
    color: var(--bs-dark);
  }

  .badge-dynamic-inv {
    background-color: var(--bs-light);
    color: var(--bs-dark);
  }

  .select2-container--bootstrap-5 .select2-selection,
  .select2-container--bootstrap-5 .select2-selection--single,
  .select2-container--bootstrap-5 .select2-selection--multiple {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-color: var(--bs-border-color);
  }

  .select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--bs-light) !important;
  }

  .select2-container--bootstrap-5 .select2-selection__placeholder {
    color: #999;
  }

  .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-color: var(--bs-border-color);
  }

  .select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    border-color: var(--bs-border-color);
  }

  .select2-container--bootstrap-5 .select2-results__option {
    background-color: var(--bs-dark);
    color: var(--bs-light);
  }

  .select2-search__field {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
  }

  .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--bs-link-hover-color-bg);
    color: var(--bs-light);
  }

  .fc-cell-shaded {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
  }
}