/* dFLEX Overrides v2.0 — minimalne style kompatybilne z Opale */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Sekcja 1: Issue List
   ============================================================ */

/* -- Zebra striping wylaczone -- */

/* -- Powiekszona czcionka i vertical centering dla WSZYSTKICH list (1.1x) -- */
table.list {
  font-size: 110%;
}

table.list td {
  vertical-align: middle;
}

td.subject,
td.comments,
td.issue {
  white-space: normal;
}

/* -- Status dot: kolorowa kropka 8px -- */
.dfx-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* -- Tracker line: badge w pierwszej linii -- */
.dfx-tracker-line {
  display: block;
  margin-bottom: 2px;
}

/* -- Status line: druga linia z kropka + tekst + priorytet -- */
.dfx-status-line {
  display: block;
  font-size: 0.8rem;
  color: #6B7280;
}

/* -- Subject line: font-weight 500 -- */
.dfx-subject-line {
  font-weight: 500;
}

/* -- Kolorowanie subject na podstawie trackera -- */
.dfx-subject-colored .dfx-subject-line a {
  color: var(--dfx-subject-color, inherit);
}

/* -- Assignee line: mniejszy font, szary -- */
.dfx-assignee-line {
  font-size: 0.8rem;
  color: #6B7280;
  margin-top: 2px;
}

.dfx-person-icon {
  font-size: 0.5rem;
  vertical-align: middle;
  margin-right: 2px;
}

.dfx-separator {
  color: #D1D5DB;
  margin: 0 4px;
}

.dfx-project-name {
  font-style: italic;
}

/* -- Tracker badge: pastelowy pill z nazwa trackera -- */
.dfx-tracker-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: lowercase;
  line-height: 1.4;
  white-space: nowrap;
}

/* -- Priority badge: inline w linii przypisanego -- */
.dfx-priority-badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}

/* -- Kolorowa klamra z lewej strony wiersza wg priorytetu -- */
table.list.issues tr.priority-1 td:first-child { border-left: 4px solid #D1D5DB; }
table.list.issues tr.priority-3 td:first-child { border-left: 4px solid #FB923C; }
table.list.issues tr.priority-4 td:first-child { border-left: 4px solid #EF4444; }

/* PILNE — pulsujacy efekt */
.dfx-priority-badge.dfx-priority-urgent {
  animation: dfx-pulse 2s ease-in-out infinite;
}

@keyframes dfx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================================
   Sekcja 1b: Time Entry List
   ============================================================ */

/* -- Activity badge: pastelowy pill z nazwa aktywnosci -- */
.dfx-activity-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

/* -- User line w time entries -- */
.dfx-user-line {
  font-weight: 500;
}

.dfx-user-line a {
  color: inherit;
}

/* -- Activity line pod nazwa uzytkownika -- */
.dfx-activity-line {
  display: block;
  margin-top: 2px;
}

/* -- Issue w time entries: dwuliniowy layout -- */
.dfx-te-issue-line {
  display: block;
  margin-bottom: 2px;
}

.dfx-te-subject-line {
  display: block;
  font-size: 0.85rem;
  color: #374151;
  margin-top: 1px;
}

/* -- Godziny wyroznienie -- */
table.list.time-entries td.hours {
  font-weight: 600;
  font-size: 1.05em;
  white-space: nowrap;
}

/* -- Data z dniem tygodnia -- */
.dfx-date-main {
  display: block;
  white-space: nowrap;
}

.dfx-date-day {
  display: block;
  font-size: 0.8rem;
  color: #6B7280;
  text-transform: capitalize;
}

/* -- Komentarz linia -- */
.dfx-comment-line {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 2px;
}

/* ============================================================
   Sekcja 1c: Globalne kolory zaznaczenia (jasniejsze niz Opale default)
   ============================================================ */

/* -- Zaznaczenie wiersza — TYLKO tlo, kolory czcionek BEZ ZMIAN -- */
/* Opale default: #628db6 + color:#fff → nadpisujemy tlo, cofamy kolor */
#wrapper table.list tr.context-menu-selection,
#wrapper table.list .context-menu-selection {
  color: unset !important;
}

#wrapper table.list tr.context-menu-selection > td,
#wrapper .context-menu-selection > td {
  background-color: #E2EAF2 !important;
  color: unset !important;
}

#wrapper table.list tr.context-menu-selection td a {
  color: unset !important;
}

/* ============================================================
   Sekcja 2: Editor
   ============================================================ */

/* -- Collapsible section: zwijane pola (parent, comment, metadane) -- */
.dfx-collapsible-section {
  margin: 8px 0;
}

.dfx-collapsible-toggle {
  cursor: pointer;
  font-size: 0.85rem;
  color: #6B7280;
  user-select: none;
  padding: 4px 0;
  display: inline-block;
}

.dfx-collapsible-toggle:hover {
  color: #374151;
}

.dfx-collapsible-content {
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.dfx-collapsible-content.collapsed {
  max-height: 0;
}

/* ============================================================
   Sekcja 3: Mermaid
   ============================================================ */

/* ============================================================
   Sekcja 4: Issue Detail — Typography & Colors
   Scope: body.controller-issues.action-show
   Mockup: dflex-redmine (brutalist/industrial)
   ============================================================ */

/* -- Globalne fonty dla calej strony issue detail -- */
body.controller-issues.action-show {
  font-family: 'Inter', sans-serif;
  color: #2D3436;
  background-color: #F8F9FA;
}

/* -- Content area — tlo + BAZOWA typografia dla calego issue detail -- */
body.controller-issues.action-show #content {
  background-color: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #2D3436;
}

/* -- Wszystkie label sekcji (Opis, Pliki, Podzagadnienia, Powiazane) — jednolity styl -- */
body.controller-issues.action-show #content > p > strong,
body.controller-issues.action-show .description > p > strong,
body.controller-issues.action-show #issue_tree > p > strong,
body.controller-issues.action-show #relations > p > strong {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(45, 52, 54, 0.4);
}

/* -- Sekcje z labelem — flex z dekoracyjna linia -- */
body.controller-issues.action-show .description > p:first-of-type,
body.controller-issues.action-show #content > hr + p,
body.controller-issues.action-show #issue_tree > p:first-of-type,
body.controller-issues.action-show #relations > p:first-of-type {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.6rem;
  margin: 0.3rem 0;
}

body.controller-issues.action-show .description > p:first-of-type::after,
body.controller-issues.action-show #content > hr + p::after,
body.controller-issues.action-show #issue_tree > p:first-of-type::after,
body.controller-issues.action-show #relations > p:first-of-type::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

/* -- Naglowek issue: "Wymaganie #2900" — display serif -- */
body.controller-issues.action-show #content > h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #2D3436;
  margin-bottom: 0.15rem;
}

/* -- Status badge obok naglowka — ciemny pill -- */
body.controller-issues.action-show .badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 2px;
  vertical-align: middle;
}

/* -- Caly blok issue.details — pelna szerokosc -- */
body.controller-issues.action-show .issue.details {
  width: 100%;
}

/* -- Nawigacja Poprzednie/Nastepne — skrajna prawa, mniejsze -- */
body.controller-issues.action-show .issue.details .next-prev-links {
  float: right !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(45, 52, 54, 0.4);
  margin: 0;
  padding: 0;
}

body.controller-issues.action-show .issue.details .next-prev-links a {
  font-size: 0.7rem;
  color: rgba(45, 52, 54, 0.5);
  text-decoration: none;
}

body.controller-issues.action-show .issue.details .next-prev-links a:hover {
  color: #2D3436;
}

/* -- Tytul issue (subject) — pelna szerokosc, czytelny -- */
body.controller-issues.action-show .issue.details .subject {
  width: 100%;
  clear: none;
}

body.controller-issues.action-show .issue.details .subject h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #2D3436;
  margin: 0.2rem 0 0.4rem 0;
  max-width: 100%;
}

/* -- Author line — lekki tekst -- */
body.controller-issues.action-show .issue.details p.author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(45, 52, 54, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  clear: both;
}

body.controller-issues.action-show .issue.details p.author a {
  color: rgba(45, 52, 54, 0.6);
}

/* -- Atrybuty: label — male uppercase tracking -- */
body.controller-issues.action-show .issue.details .attributes .label {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(45, 52, 54, 0.4);
}

/* -- Atrybuty: value — mono font -- */
body.controller-issues.action-show .issue.details .attributes .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2D3436;
}

body.controller-issues.action-show .issue.details .attributes .value a {
  color: #2D3436;
}

/* -- Atrybuty: sekcja — brutalist grid z cienkimi borderami -- */
body.controller-issues.action-show .issue.details .attributes {
  background-color: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

body.controller-issues.action-show .issue.details .attributes .splitcontent,
body.controller-issues.action-show .issue.details .attributes .splitcontentleft,
body.controller-issues.action-show .issue.details .attributes .splitcontentright {
  flex: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
  float: none;
  width: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

body.controller-issues.action-show .issue.details .attributes .attribute {
  background-color: #fff;
  padding: 0.7rem 1.2rem;
  flex: 1 1 auto;
  min-width: 180px;
}

/* -- Opis (description) — wyrazny blok, najwazniejsza sekcja -- */
body.controller-issues.action-show .description {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2D3436;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-left: 4px solid #2D3436;
  padding: 1.2rem 2rem;
  margin: 0.5rem 0;
}

body.controller-issues.action-show .description .wiki {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ============================================================
   Sekcja 5: Wiki Content — GLOBALNE style brutalist
   Scope: kazdy .wiki w Redmine (issues, wiki pages, journals)
   ============================================================ */

/* -- Wiki: bazowa typografia -- */
.wiki {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2D3436;
}

/* -- Wiki: paragrafy — czytelne odstepy -- */
.wiki p {
  margin: 0.5rem 0;
}

/* -- Wiki: blockquote — italic z klamra z lewej (jak w mockupie) -- */
.wiki blockquote {
  font-style: italic;
  opacity: 0.85;
  border: none !important;
  border-left: 4px solid #2D3436 !important;
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1rem 0;
  background: transparent !important;
  color: inherit;
}

.wiki blockquote p {
  margin: 0.2rem 0;
}

/* -- Wiki: naglowki h1-h3 — display serif z dekoracyjna linia -- */
.wiki h1,
.wiki h2,
.wiki h3 {
  font-family: 'Playfair Display', serif !important;
  font-weight: 900;
  color: #2D3436;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wiki h1::after,
.wiki h2::after,
.wiki h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

/* -- Anchor link (pilcrow) wewnatrz naglowka — nie lamie flex -- */
.wiki h1 > a.wiki-anchor,
.wiki h2 > a.wiki-anchor,
.wiki h3 > a.wiki-anchor {
  order: 10;
  flex: none;
  font-size: 0.6em;
  opacity: 0.2;
  text-decoration: none;
}

.wiki h1 { font-size: 0.88rem; margin: 0.75rem 0 0.4rem; }
.wiki h2 { font-size: 0.68rem; margin: 0.6rem 0 0.3rem; }
.wiki h3 { font-size: 0.56rem; margin: 0.45rem 0 0.25rem; }

.wiki h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.47rem;
  color: #2D3436;
  margin: 0.45rem 0 0.25rem;
}

/* -- Wiki: listy ol/ul — lepsza typografia, spacing -- */
.wiki ol,
.wiki ul {
  padding-left: 1.5rem;
  margin: 0.6rem 0;
}

.wiki li {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.wiki li strong {
  font-weight: 600;
  color: #2D3436;
}

.wiki li ul,
.wiki li ol {
  margin: 0.2rem 0;
}

/* -- Wiki: callout box — betonowe tlo + brutalist border -- */
.wiki div.flash,
.wiki div.box,
.wiki .note,
.wiki .tip,
.wiki .warning {
  background-color: #E9ECEF !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 2px;
  padding: 1.5rem 2rem;
  margin: 1.2rem 0;
}

.wiki .note p:first-child,
.wiki .tip p:first-child,
.wiki .warning p:first-child {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 0;
}

/* -- Wiki: pre/code — mono z betonowym tlem -- */
.wiki pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background-color: #E9ECEF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  padding: 1rem 1.5rem;
  margin: 0.8rem 0;
  overflow-x: auto;
}

.wiki code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background-color: #E9ECEF;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}

.wiki pre code {
  background: transparent;
  padding: 0;
}

/* -- Wiki: tabele — czyste brutalist borders -- */
.wiki table {
  border-collapse: collapse;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0.8rem 0;
  width: 100%;
}

.wiki table th {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(45, 52, 54, 0.5);
  background-color: #F8F9FA;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.6rem 1rem;
  text-align: left;
}

.wiki table td {
  font-size: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
}

/* -- Wiki: linki — subtelne, z underline offset -- */
.wiki a {
  color: #2D3436;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(45, 52, 54, 0.3);
}

.wiki a:hover {
  text-decoration-color: #2D3436;
}

/* -- Wiki: linki WEWNATRZ naglowkow — dziedzicza styl naglowka -- */
.wiki h1 a:not(.wiki-anchor),
.wiki h2 a:not(.wiki-anchor),
.wiki h3 a:not(.wiki-anchor),
.wiki h4 a:not(.wiki-anchor) {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

.wiki h1 a:not(.wiki-anchor):hover,
.wiki h2 a:not(.wiki-anchor):hover,
.wiki h3 a:not(.wiki-anchor):hover,
.wiki h4 a:not(.wiki-anchor):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(45, 52, 54, 0.3);
}

/* -- Wiki: external links — ikona i skrocony URL -- */
.wiki a.external {
  word-break: break-all;
}

/* -- Wiki: obrazki — brutalist border -- */
.wiki img {
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0.5rem 0;
  max-width: 100%;
}

/* -- Wiki: hr — subtelne separatory -- */
.wiki hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 1rem 0;
}

/* ============================================================
   Sekcja 5b: Wiki Page — dodatkowe style dla body.controller-wiki
   ============================================================ */

/* -- Wiki page: tlo i fonty -- */
body.controller-wiki {
  font-family: 'Inter', sans-serif;
  color: #2D3436;
  background-color: #F8F9FA;
}

body.controller-wiki #content {
  background-color: transparent;
}

/* -- Wiki page: content area — bialy box brutalist -- */
body.controller-wiki .wiki.wiki-page {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem 2.5rem;
  font-size: 1.05rem;
}

/* -- Wiki page: sidebar — brutalist box -- */
body.controller-wiki #sidebar {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

body.controller-wiki #sidebar h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: #2D3436;
  margin-bottom: 0.8rem;
}

/* -- Wiki page: edit section icons — subtelne -- */
body.controller-wiki .contextual.heading-1,
body.controller-wiki .contextual.heading-2,
body.controller-wiki .contextual.heading-3 {
  opacity: 0.3;
  transition: opacity 0.15s ease;
}

body.controller-wiki .contextual.heading-1:hover,
body.controller-wiki .contextual.heading-2:hover,
body.controller-wiki .contextual.heading-3:hover {
  opacity: 1;
}

/* (stare selektory sekcji przeniesione do bloku "BAZOWA typografia" powyzej) */

/* -- Separatory hr — cienkie, jasne -- */
body.controller-issues.action-show .issue.details ~ hr,
body.controller-issues.action-show .issue.details hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0.5rem 0;
}

/* -- Historia — typography -- */
body.controller-issues.action-show #history .tabs ul li a {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.controller-issues.action-show .journal .note-header {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: rgba(45, 52, 54, 0.6);
}

body.controller-issues.action-show .journal .details li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* -- Sidebar — brutalist box z typography -- */
body.controller-issues.action-show #sidebar {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

body.controller-issues.action-show #sidebar h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: #2D3436;
  margin-bottom: 0.8rem;
}

/* -- Akcje contextual — subtlne -- */
body.controller-issues.action-show .contextual a {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* -- Pliki (attachments) — brutalist cards -- */
body.controller-issues.action-show .attachments {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

body.controller-issues.action-show .attachments p {
  background-color: #E9ECEF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.6rem 1rem;
  margin-bottom: 2px;
  transition: background-color 0.15s ease;
}

body.controller-issues.action-show .attachments p:hover {
  background-color: #DEE2E6;
}

body.controller-issues.action-show .attachments a.icon-attachment {
  font-weight: 500;
  color: #2D3436;
  text-decoration: none;
}

body.controller-issues.action-show .attachments .size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(45, 52, 54, 0.4);
}

body.controller-issues.action-show .attachments .author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(45, 52, 54, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
