/* Główny wrapper */
.nbt-cal-wrapper {
  max-width: 1500px;
  width: 100%;
  margin: 0px auto;
  padding: 0 16px;
  overflow: visible;
}

/* Kalendarz */
#nbt-calendar {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #eeeeee;
  padding: 32px;
  width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.nbt-cal-scroll {
  width: 100%;
}

/* Nagłówek z nawigacją */
.nbt-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 10px;
  padding: 18px 24px;
  border-radius: 16px;
  background: #f8f8f8;
  border: 1px solid #eeeeee;
}

.nbt-cal-month-label {
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
}

.nbt-cal-nav {
  display: flex;
  gap: 8px;
}

.nbt-cal-nav button {
  background: #e7727b;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nbt-cal-nav button:hover {
  background: #d9626c;
  transform: translateY(-1px);
}

.nbt-cal-nav button:focus-visible {
  outline: 2px solid #e7727b;
  outline-offset: 2px;
}

/* Dni tygodnia */
.nbt-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  background: #f8f8f8;
  border-radius: 12px 12px 0 0;
}

.nbt-cal-weekday {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #000;
}

/* Siateczka dni */
.nbt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #eeeeee;
  border-top: none;
  border-radius: 0 0 16px 16px;
  overflow: visible;
}

.nbt-cal-day {
  min-height: 120px;
  border-right: 1px solid #eeeeee;
  border-top: 1px solid #eeeeee;
  padding: 12px 10px 18px;
  font-size: 13px;
  vertical-align: top;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  background: #fff;
}

.nbt-cal-day:nth-child(7n) {
  border-right: none;
}

.nbt-cal-day-empty {
  background: #f8f8f8;
}

/* Numer dnia i nagłówek komórki */
.nbt-cal-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.nbt-cal-day-number {
  font-weight: 700;
  font-size: 16px;
}

.nbt-cal-event-count {
  background: #e7727b;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  min-width: 26px;
  text-align: center;
  padding: 2px 8px;
  font-weight: 600;
}

/* Lista świąt */
.nbt-cal-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nbt-cal-events li {
  margin: 0;
}

.nbt-cal-event-link {
  text-decoration: none;
  color: #000;
  line-height: 1.5;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #f9f9f9;
  border: 1px solid #eeeeee;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: border 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-shadow: none;
}

.nbt-cal-event-link::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e7727b;
  flex-shrink: 0;
}

.nbt-cal-event-link:hover {
  border-color: #e7727b;
  color: #e7727b;
  transform: translateY(-1px);
}

.nbt-cal-day-has-event {
  border-color: rgba(231, 114, 123, 0.5);
  box-shadow: inset 0 0 0 1px rgba(231, 114, 123, 0.25);
}

/* Dzisiaj */
.nbt-cal-day-today {
  outline: 2px solid #e7727b;
  outline-offset: -2px;
  background: linear-gradient(180deg, rgba(231, 114, 123, 0.08), rgba(255, 255, 255, 0));
}

.nbt-cal-day-preview {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 18px);
  width: min(300px, calc(100vw - 40px));
  background: #f5f5f5;
  color: #000;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
  border: 1px solid #eeeeee;
}

.nbt-cal-day-preview::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent #eeeeee transparent;
}

.nbt-cal-day-preview-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #eeeeee;
  background: #fff;
  margin-bottom: 12px;
  color: #000;
  text-decoration: none;
  transition: border 0.2s ease, color 0.2s ease;
}

.nbt-cal-day-preview-item:last-child {
  margin-bottom: 0;
}

.nbt-cal-day-preview-item:hover {
  border-color: #e7727b;
  color: #e7727b;
}

.nbt-cal-day-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #eeeeee;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid #e2e2e2;
}

.nbt-cal-day-preview-thumb-has-image {
  border-color: #e7727b;
}

.nbt-cal-day-preview-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nbt-cal-day-preview-title {
  font-weight: 600;
  font-size: 14px;
  color: #000;
}

.nbt-cal-day-preview-desc {
  font-size: 13px;
  color: #000;
  line-height: 1.4;
}

.nbt-cal-day-has-event:hover .nbt-cal-day-preview,
.nbt-cal-day-has-event:focus-within .nbt-cal-day-preview {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 10px);
}

@media (max-width: 1024px) {
  .nbt-cal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nbt-cal-month-label {
    text-align: center;
  }

  .nbt-cal-nav {
    width: 100%;
    justify-content: space-between;
  }

  .nbt-cal-nav button {
    flex: 1;
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nbt-cal-wrapper {
    padding: 0 12px;
  }

  #nbt-calendar {
    padding: 18px;
  }

  .nbt-cal-month-label {
    font-size: 16px;
  }

  .nbt-cal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding-bottom: 12px;
  }

  .nbt-cal-scroll::-webkit-scrollbar {
    height: 6px;
  }

  .nbt-cal-scroll::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 999px;
  }

  .nbt-cal-weekdays,
  .nbt-cal-grid {
    min-width: 760px;
  }

  .nbt-cal-weekday {
    font-size: 11px;
    padding: 8px 2px;
  }

  .nbt-cal-day {
    min-height: 80px;
    padding: 8px 4px 12px;
    font-size: 12px;
  }

  .nbt-cal-day-number {
    font-size: 13px;
  }

  .nbt-cal-events li {
    margin-bottom: 6px;
  }

  .nbt-cal-event-link {
    padding: 5px 8px;
    gap: 6px;
  }

  .nbt-cal-day-preview {
    display: none;
  }
}

@media (max-width: 520px) {
  #nbt-calendar {
    padding: 14px 12px;
  }

  .nbt-cal-weekdays,
  .nbt-cal-grid {
    min-width: 680px;
  }

  .nbt-cal-nav {
    flex-direction: column;
    gap: 8px;
  }

  .nbt-cal-nav button {
    width: 100%;
  }

  .nbt-cal-day {
    min-height: 70px;
    padding: 6px 2px 10px;
  }

  .nbt-cal-events li {
    font-size: 11px;
  }

  .nbt-cal-event-link {
    padding: 4px 6px;
  }

  .nbt-cal-day-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
