
/* ==================================================
   /css/bug-report.css
   BULDO — WYSUWANY PANEL ZGŁASZANIA BŁĘDÓW
   ================================================== */

.bug-report {
  --bug-orange: #f28c28;
  --bug-dark: #172331;
  --bug-border: #dce2e8;

  position: fixed;
  top: 0;
  right: 0;
  z-index: 10000;
  font-family: inherit;
}

/* ZAKŁADKA BOCZNA */

.bug-report-tab {
  position: fixed;
  top: 45%;
  right: 0;
  z-index: 10002;

  display: flex;
  align-items: center;
  gap: 9px;

  padding: 13px 15px;
  border: 0;
  border-radius: 9px 0 0 9px;

  background: var(--bug-orange);
  color: #172331;

  font-size: 13px;
  font-weight: 700;
  cursor: pointer;

  box-shadow: 0 3px 14px rgba(0, 0, 0, .2);
  transition:
  right .3s ease,
  background .2s ease,
  transform .8s cubic-bezier(.22, 1, .36, 1);
}

.bug-report-tab:hover {
  background: #ff9d3c;
}

/* PANEL */

.bug-report-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10001;

  width: min(420px, 100vw);
  height: 100vh;
  height: 100dvh;

  background: #fff;
  color: var(--bug-dark);

  box-shadow: -8px 0 30px rgba(0, 0, 0, .22);

  transform: translateX(105%);
  visibility: hidden;

  transition:
    transform .3s ease,
    visibility .3s ease;

  overflow-y: auto;
  overscroll-behavior: contain;
}

/* OTWARTY PANEL */

.bug-report.is-open .bug-report-panel {
  transform: translateX(0);
  visibility: visible;
}

.bug-report.is-open .bug-report-tab {
  right: min(420px, 100vw);
  border-radius: 9px 0 0 9px;
}

/* NAGŁÓWEK */

.bug-report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;

  padding: 24px;
  background: var(--bug-dark);
  color: #fff;
}

.bug-report-header h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 22px;
  line-height: 1.3;
}

.bug-report-header p {
  margin: 0;
  color: #cbd5df;
  font-size: 13px;
}

.bug-report-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  color: #fff;

  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* FORMULARZ */

.bug-report-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.bug-report-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bug-report-field label,
.bug-report-types legend {
  color: var(--bug-dark);
  font-size: 13px;
  font-weight: 700;
}

.bug-report-field input,
.bug-report-field select,
.bug-report-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 43px;
  padding: 11px 12px;

  border: 1px solid var(--bug-border);
  border-radius: 7px;

  background: #fff;
  color: var(--bug-dark);
  font: inherit;
  font-size: 14px;
}

.bug-report-field textarea {
  min-height: 125px;
  resize: vertical;
}

.bug-report-field input:focus,
.bug-report-field select:focus,
.bug-report-field textarea:focus {
  outline: 2px solid var(--bug-orange);
  outline-offset: 1px;
}

.bug-report-field input[type="file"] {
  padding: 9px;
}

.bug-report-field small {
  color: #687787;
  font-size: 12px;
}

/* RODZAJ ZGŁOSZENIA */

.bug-report-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin: 0;
  padding: 0;
  border: 0;
}

.bug-report-types legend {
  margin-bottom: 12px;
}

.bug-report-types label {
  position: relative;
  flex: 1;
  min-width: 90px;
  cursor: pointer;
}

.bug-report-types input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.bug-report-types span {
  display: block;
  padding: 11px 8px;

  border: 1px solid var(--bug-border);
  border-radius: 7px;

  background: #f7f9fb;
  color: var(--bug-dark);

  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.bug-report-types input:checked + span {
  border-color: var(--bug-orange);
  background: #fff0df;
  color: #a84e00;
}

.bug-report-types input:focus-visible + span {
  outline: 2px solid var(--bug-orange);
  outline-offset: 2px;
}

/* PRZYCISK WYSYŁANIA */

.bug-report-submit {
  width: 100%;
  padding: 14px;

  border: 0;
  border-radius: 7px;

  background: var(--bug-orange);
  color: #172331;

  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.bug-report-submit:hover:not(:disabled) {
  background: #ff9d3c;
}

.bug-report-submit:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.bug-report-note {
  margin: -10px 0 0;
  color: #687787;
  text-align: center;
  font-size: 12px;
}

.bug-report-status:empty {
  display: none;
}

/* MOBILE */

@media (max-width: 767px) {
  .bug-report-tab {
    top: 40%;
    padding: 11px 9px;
    font-size: 12px;
  }

  .bug-report.is-open .bug-report-tab {
    display: none;
  }

  .bug-report-header {
    padding: 20px;
  }

  .bug-report-form {
    padding: 20px 18px 90px;
  }
}

/* OGRANICZENIE ANIMACJI */

@media (prefers-reduced-motion: reduce) {
  .bug-report-panel,
  .bug-report-tab {
    transition: none;
  }
}

/* Izolacja przycisku od globalnych stylów panelu */
.bug-report .bug-report-tab {
  width: max-content;
  max-width: 100vw;
  min-width: 0;
  flex: none;
  transition: transform .8s cubic-bezier(.22, 1, .36, 1),
            right .3s ease,
            background .2s ease;
}

/* ==================================================
   /css/bug-report.css
   IZOLACJA PRZYCISKU ZAMYKANIA OD STYLÓW ADMINA
   ================================================== */

.bug-report .bug-report-close {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;

  height: 34px;
  min-height: 34px;
  max-height: 34px;

  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Automatyczne zwijanie zakładki */

.bug-report.is-collapsed:not(.is-open) .bug-report-tab {
  transform: translateX(calc(100% - 45px));
}

.bug-report.is-collapsed:not(.is-open) .bug-report-tab:hover,
.bug-report.is-collapsed:not(.is-open) .bug-report-tab:focus-visible {
  transform: translateX(0);
}

@media (max-width: 767px) {
  .bug-report.is-collapsed:not(.is-open) .bug-report-tab {
    transform: translateX(calc(100% - 37px));
  }
}

/* Bez animacji przy ponownym wejściu na podstronę */
.bug-report.no-collapse-animation:not(.is-open) .bug-report-tab {
  transition: none;
}