/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Ustawiane przez resizable-panel (szerokość lewego menu + inset); stopka czatu — wyśrodkowanie w kolumnie obok menu */
:root {
  --adacta-main-margin-left: 0px;
  --adacta-main-margin-right: 0px;
}

/* Dodatkowe style dla kontenerów zawartości */
.container, .max-w-7xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
  margin-bottom: 2rem; /* Dodatkowy margines dla kontenerów */
}

/* Style dla mobilnych urządzeń */
@media (max-width: 640px) {
  .container, .max-w-7xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
    margin-bottom: 3rem; /* Większy margines dla mobilnych urządzeń */
  }
}

/* Fixed footer: max-w-7xl is only for width; page-flow container margin does not apply */
#application-footer .max-w-7xl {
  margin-bottom: 0;
}

/*
 * Sprawa bez otwartego dokumentu: textarea w stopce — nadpisanie .hidden z footer-suggestions-panel
 * (ładowane po tailwind.css; działa także gdy testy biorą starszy fingerprint z public/assets).
 */
[data-controller~="footer-chat"][data-footer-chat-defer-transcript-until-thread-value="true"] #footer-suggestions-panel-content,
[data-controller~="footer-chat"][data-footer-chat-defer-transcript-until-thread-value=true] #footer-suggestions-panel-content {
  display: block !important;
}

/* Home workspace (sprawa): max-w-3xl ogranicza szerokość — bez dodatkowego marginesu nad stałą stopką (body ma już padding-bottom). */
#main-content .max-w-3xl {
  margin-bottom: 0;
}

/* Animacja przełączania ikon skanera – 4 obrazy, instant switch, 8s cykl */
.scan-icon-switch-1,
.scan-icon-large-1 {
  animation: scan-icon-switch-1 8s steps(1) infinite;
  -webkit-animation: scan-icon-switch-1 8s steps(1) infinite;
}
.scan-icon-switch-2,
.scan-icon-large-2 {
  animation: scan-icon-switch-2 8s steps(1) infinite;
  -webkit-animation: scan-icon-switch-2 8s steps(1) infinite;
}
.scan-icon-switch-3,
.scan-icon-large-3 {
  animation: scan-icon-switch-3 8s steps(1) infinite;
  -webkit-animation: scan-icon-switch-3 8s steps(1) infinite;
}
.scan-icon-switch-4,
.scan-icon-large-4 {
  animation: scan-icon-switch-4 8s steps(1) infinite;
  -webkit-animation: scan-icon-switch-4 8s steps(1) infinite;
}
@keyframes scan-icon-switch-1 {
  0%, 24.999% { opacity: 1; }
  25%, 100% { opacity: 0; }
}
@-webkit-keyframes scan-icon-switch-1 {
  0%, 24.999% { opacity: 1; }
  25%, 100% { opacity: 0; }
}
@keyframes scan-icon-switch-2 {
  0%, 24.999% { opacity: 0; }
  25%, 49.999% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@-webkit-keyframes scan-icon-switch-2 {
  0%, 24.999% { opacity: 0; }
  25%, 49.999% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes scan-icon-switch-3 {
  0%, 49.999% { opacity: 0; }
  50%, 74.999% { opacity: 1; }
  75%, 100% { opacity: 0; }
}
@-webkit-keyframes scan-icon-switch-3 {
  0%, 49.999% { opacity: 0; }
  50%, 74.999% { opacity: 1; }
  75%, 100% { opacity: 0; }
}
@keyframes scan-icon-switch-4 {
  0%, 74.999% { opacity: 0; }
  75%, 100% { opacity: 1; }
}
@-webkit-keyframes scan-icon-switch-4 {
  0%, 74.999% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

/* Hub dokumentów: ikona oczekującego skanu — zamiana SCAN <-> skaner co 1s. */
.adacta-scan-swap-icon {
  position: absolute;
  inset: 0;
}

.adacta-scan-swap-primary {
  animation: adacta-scan-swap-primary 1s steps(1, end) infinite;
  -webkit-animation: adacta-scan-swap-primary 1s steps(1, end) infinite;
}

.adacta-scan-swap-secondary {
  animation: adacta-scan-swap-secondary 1s steps(1, end) infinite;
  -webkit-animation: adacta-scan-swap-secondary 1s steps(1, end) infinite;
}

@keyframes adacta-scan-swap-primary {
  0%, 49.999% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@-webkit-keyframes adacta-scan-swap-primary {
  0%, 49.999% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes adacta-scan-swap-secondary {
  0%, 49.999% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@-webkit-keyframes adacta-scan-swap-secondary {
  0%, 49.999% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .adacta-scan-swap-primary,
  .adacta-scan-swap-secondary {
    animation: none;
    -webkit-animation: none;
  }

  .adacta-scan-swap-secondary {
    opacity: 0;
  }
}

/* Delikatne pulsowanie dla "(Skanowanie...)" i "→ sprawdź i zapisz!" */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.animate-pulse-subtle {
  animation: pulse-subtle 1.5s ease-in-out infinite;
  -webkit-animation: pulse-subtle 1.5s ease-in-out infinite;
}

/* Style dla rozszerzonej listy plików - gdy prawy panel jest ukryty */
.file-list-expanded {
  flex: 1 1 auto !important;
  flex-grow: 1 !important;
  flex-shrink: 1 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Przyciski Kopiuj — styl „pill” jak w przykładzie (inner glow, cień, fazy, spinner) */
.clipboard-copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* +5px wysokości vs 2px — 4.5px góra/dół */
  padding: 4.5px 10px;
  min-height: 0;
  border: none;
  border-radius: 9999px;
  /* Idle „Kopiuj” — szary zamiast czerni */
  background: #525252;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    background 0.45s ease-in-out,
    box-shadow 0.3s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.dark .clipboard-copy-btn {
  background: #3f3f46;
  color: #f4f4f5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.clipboard-copy-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.dark .clipboard-copy-btn::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.clipboard-copy-btn:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.85);
  outline-offset: 2px;
}

.clipboard-copy-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.clipboard-copy-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.clipboard-copy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.92;
}

.clipboard-copy-btn__content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Slot 18×18 — ta sama skala co spinner i ptaszek; ikona „Kopiuj” znika przy .hidden (nie nadpisuj display: block) */
.clipboard-copy-btn__icon-slot {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.clipboard-copy-btn__svg-copy {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.clipboard-copy-btn__svg-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.clipboard-copy-btn__label {
  white-space: nowrap;
}

/* Wersja tylko z ikoną (np. lista notatek) — ten sam szary idle co „Kopiuj”, zaokrąglenie jak przycisk UI */
.clipboard-copy-btn.clipboard-copy-btn--icon-only {
  padding: 6px;
  border-radius: 0.5rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
}

.clipboard-copy-btn--icon-only .clipboard-copy-btn__icon-slot {
  width: 24px;
  height: 24px;
}

.clipboard-copy-btn--icon-only .clipboard-copy-btn__svg-copy,
.clipboard-copy-btn--icon-only .clipboard-copy-btn__svg-check {
  width: 24px;
  height: 24px;
}

.clipboard-copy-btn--icon-only .clipboard-copy-btn__spinner.spinner-ring {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.annotation-autocomplete-ghost {
  font-size: 0.75rem;
  line-height: 1.3;
  margin-top: 0.25rem;
  padding: 0 0.25rem;
  color: #9ca3af;
  font-style: italic;
  pointer-events: none;
  user-select: none;
  white-space: pre-wrap;
}

.dark .annotation-autocomplete-ghost {
  color: #6b7280;
}

/* Pasek akcji notatek: spoczynek — tylko delikatna szara ikona (bez „kasetki”, cienia, obramowania) */
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  ):not(.clipboard-copy-btn--phase-error) {
  background: transparent !important;
  box-shadow: none !important;
  color: #9ca3af;
  transition:
    color 0.15s ease,
    background 0.35s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease,
    border-radius 0.22s ease;
}

.dark
  .clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  ):not(.clipboard-copy-btn--phase-error) {
  background: transparent !important;
  box-shadow: none !important;
  color: #9ca3af;
}

.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  )::before {
  opacity: 0;
  pointer-events: none;
}

.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:hover:not(:disabled):not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  ) {
  filter: none;
  color: #6b7280;
}

.dark
  .clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:hover:not(:disabled):not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  ) {
  filter: none;
  color: #d1d5db;
}

.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal:active:not(:disabled):not(.clipboard-copy-btn--phase-loading):not(
    .clipboard-copy-btn--phase-done
  ) {
  transform: scale(0.96);
}

/* Podczas fazy ładowania/„gotowe” pełna nieprzezroczystość mimo :disabled */
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal.clipboard-copy-btn--phase-loading:disabled,
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal.clipboard-copy-btn--phase-done:disabled {
  opacity: 1;
}

/* Aktywne fazy (niebieski / żółty): wymuszony okrąg — stały kwadrat + 50%, bez „squircle” */
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal.clipboard-copy-btn--phase-loading,
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal.clipboard-copy-btn--phase-done,
.clipboard-copy-btn.clipboard-copy-btn--toolbar-minimal.clipboard-copy-btn--phase-error {
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: 50%;
}

.clipboard-copy-btn--phase-loading {
  background: #007ffd !important;
  box-shadow: 0 2px 12px rgba(0, 127, 253, 0.35);
}

.dark .clipboard-copy-btn--phase-loading {
  background: #0066cc !important;
  box-shadow: 0 2px 14px rgba(0, 100, 200, 0.4);
}

/* Stan „Skopiowano” — żółty jak w specyfikacji; ciemny tekst i ikony (currentColor) */
.clipboard-copy-btn--phase-done {
  background: #ffe84b !important;
  color: #171717;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.dark .clipboard-copy-btn--phase-done {
  background: #ffe84b !important;
  color: #171717;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.clipboard-copy-btn--phase-done::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    transparent 55%,
    rgba(0, 0, 0, 0.06) 100%
  );
}

.clipboard-copy-btn--phase-error {
  background: #dc2626 !important;
  color: #fff;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.35);
}

.dark .clipboard-copy-btn--phase-error {
  background: #b91c1c !important;
  box-shadow: 0 2px 14px rgba(185, 28, 28, 0.45);
}

@keyframes clipboard-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.clipboard-copy-btn__spinner.spinner-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 3.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: clipboard-spinner-spin 0.7s linear infinite;
}

@keyframes clipboard-spring {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.96);
  }
  75% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.clipboard-copy-btn.clipboard-copy--spring {
  animation: clipboard-spring 0.55s cubic-bezier(0.34, -1.2, 0.32, 1.4) forwards;
}

@keyframes clipboard-ripple-expand {
  to {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

.clipboard-copy-ripple {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%) scale(0);
  animation: clipboard-ripple-expand 0.6s ease-out forwards;
}

.dark .clipboard-copy-ripple {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Footer behind modal overlay (so it gets blurred) when upload matter-destination modal is open */
body.upload-modal-open #application-footer {
  z-index: 30;
}

/* Lista dokumentow w sprawie: ikona kasowania widoczna dopiero po hover/focus. */
.matter-file-row .matter-file-delete-action {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.matter-file-row:hover .matter-file-delete-action,
.matter-file-row:focus-within .matter-file-delete-action {
  opacity: 1;
  pointer-events: auto;
}

