/* --- SZKLANY MODAL (CZYTNIK RAPORTÓW) --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--modal-bg); /* Przyciemnienie tła aplikacji */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999; /* Zawsze na samej górze */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 850px;
  max-height: 85vh; /* Nigdy nie wyjdzie poza ekran */
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  margin-bottom: 0; /* reset z klasy glass-panel */
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--overlay-10);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.modal-title-group { display: flex; align-items: center; gap: 15px; }
.modal-title-group h2 { color: var(--text-main); font-size: 20px; }

.close-btn {
  font-size: 20px; color: var(--text-muted); cursor: pointer;
  background: none; border: none; transition: color 0.2s;
}
.close-btn:hover { color: #EF4444; }

.modal-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; color: var(--text-muted); font-size: 13px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 15px;
  padding-right: 15px; /* miejsce na pasek przewijania */
}

/* Stylowanie paska przewijania (Scrollbar) wewnątrz czytnika */
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--table-header); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.6); }

.modal-footer {
  border-top: 1px solid var(--overlay-10);
  padding-top: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================
   SPECYFICZNE STYLE DLA: CZYTNIK RAPORTÓW (REPORT MODAL)
   ========================================================== */
.report-modal__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  cursor: pointer;
}

.report-modal__header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.report-modal__company-wrapper {
  cursor: pointer;
  display: inline-block;
}

.report-modal__company-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-muted);
}

.report-modal__ticker-wrapper {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 4px;
}

.report-modal__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
  color: var(--text-main);
}

.report-modal__action-btn {
  margin-left: 15px;
}

.report-modal__text-content {
  margin-bottom: 20px;
}

.report-modal__source-link {
  color: var(--neon-cyan);
  text-decoration: none;
  border-bottom: 1px dashed var(--neon-cyan);
  display: inline-block;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.report-modal__source-link:hover {
  background: rgba(0, 212, 255, 0.1);
}

/* --- Sekcja AI wewnątrz czytnika --- */
.report-modal__ai-box {
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 25px;
}

.report-modal__ai-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-modal__ai-title {
  font-weight: bold;
  color: var(--text-ai);
  font-size: 15px;
}

.report-modal__ai-text {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* --- Załączniki w czytniku --- */
.report-modal__attachments {
  margin-top: 30px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.report-modal__attachments-title {
  color: var(--text-main);
  font-size: 14px;
  margin-bottom: 15px;
}

.report-modal__attachment-link {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  /* Resztę dziedziczy z globalnej klasy .attachment-download-link */
}

.report-modal__attachment-name {
  word-break: break-all;
  color: var(--neon-cyan);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 3px;
}

.report-modal__attachment-help {
  color: var(--neon-cyan);
  font-size: 11px;
}

/* ==========================================================
   KOMPONENT: MODALE (FORMULARZE I POTWIERDZENIA)
   ========================================================== */
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group--spaced {
  margin-bottom: 25px;
}

/* Modale potwierdzające (np. usuwanie) */
.modal-content--center {
  max-width: 400px;
  text-align: center;
  padding: 30px;
}

.modal-huge-icon {
  font-size: 48px;
  margin-bottom: 15px;
  color: #EF4444; /* Domyślnie czerwony dla kosza/usuwania */
}

.modal-confirm-title {
  color: var(--text-main);
  margin-bottom: 10px;
  font-size: 20px;
}

.modal-confirm-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
  line-height: 1.5;
}

/* Ramka z przełącznikiem (np. Push w ustawieniach kolekcji) */
.toggle-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background: rgba(0, 212, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  border: 1px dashed rgba(0, 212, 255, 0.3);
  margin-bottom: 25px;
}

.toggle-box__title {
  display: block;
  font-size: 14px;
  color: var(--text-main);
  font-weight: bold;
  margin-bottom: 4px;
}

.toggle-box__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

.webhook-list-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}


/* ==========================================================
   MODAL: ZARZĄDZANIE SKŁADEM KOLEKCJI
   ========================================================== */
.ccm-list__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--overlay-03);
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid var(--overlay-05);
  margin-bottom: 8px;
}

.ccm-list__company-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ccm-list__logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 2px;
}

.ccm-list__ticker {
  font-size: 11px;
  color: var(--neon-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.ccm-list__name {
  color: var(--text-main);
  font-size: 14px;
}