.calendar-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#calendar {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  color: #ddd;
  display: none;
}

.fc-scrollgrid-section-header {
  background: var(--bs-dark) !important;
}

.fc .fc-scrollgrid {
  border-bottom-width: 1px !important;
  border-right-width: 1px !important;
}

.fc-col-header-cell-cushion {
  color: var(--bs-yellow) !important;
}

.fc-toolbar.fc-header-toolbar {
  background: var(--bs-dark) !important;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.fc-toolbar-title {
  color: #fff;
  font-weight: 600;
  white-space: normal;
  text-align: center;
  text-transform: uppercase;
}

.fc-button {
  background: #2c2c2c !important;
  border: 1px solid #444 !important;
  color: #ddd !important;
}

.fc-button:hover {
  background: #3a3a3a !important;
}

.fc-theme-standard td,
.fc-theme-standard th {
  border-color: #444;
}

.fc-daygrid-day {
  background: #252525;
  text-align: center;
}
.fc-daygrid-day:hover {
  background: #2f2f2f;
}

.fc-day-today {
  background: #333 !important;
  border: 1px solid #666 !important;
}

.fc-daygrid-day-number {
  color: #fff;
  font-weight: 600;
}

.fc-daygrid-day-number:hover {
  color: var(--bs-white);
}

.fc-event,
.fc-list-event {
  cursor: pointer !important;
}

.fc-list {
  border: 1px solid #333;
  background: #1e1e1e;
}

.fc-list-event-dot {
  border-color: #d9534f !important;
}

.fc-list-event.done .fc-list-event-dot {
  border-color: #4caf50 !important;
  background: #4caf50 !important;
}

/* Neodslúžená */
.fc-list-event.pending .fc-list-event-dot {
  border-color: #d9534f !important;
  background: #d9534f !important;
}

@media (max-width: 600px) {
  #calendar {
    padding: 10px;
  }

  .fc-theme-standard .fc-list-day-cushion {
    background: var(--bs-dark) !important;
  }

  .fc .fc-list-event:hover td {
    background: #444 !important;
  }

  .fc-list-day-text {
    color: var(--bs-yellow) !important;
  }

  .fc-list-day-side-text {
    color: var(--bs-yellow) !important;
  }

  .fc-header-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* TITLE → vždy hore */
  .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) {
    order: 1;
    width: 100%;
    display: flex !important;
    justify-content: center !important;
  }

  .fc-toolbar-title {
    font-size: 1.5rem !important;
    text-align: center;
    width: 100%;
  }

  /* Prev / Today / Next → jeden riadok */
  .fc-header-toolbar .fc-toolbar-chunk:nth-child(1),
  .fc-header-toolbar .fc-toolbar-chunk:nth-child(3) {
    order: 2; /* pod nadpisom */
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 10px !important;
    width: auto;
    flex-wrap: nowrap !important; /* zabrání zlomeniu */
  }

  .fc-button {
    padding: 5px 8px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  /* List view scroll */
  .calendar-wrapper.list-scroll {
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 600px) and (max-width: 900px) {
  .fc-toolbar-title {
    font-size: 1.3rem !important;
  }
}

@media (min-width: 1200px) {
  #calendar {
    padding: 30px;
  }
  .fc-toolbar-title {
    font-size: 1.6rem;
  }
}
