/* =========================================
   FJALORI TATIMOR
   Vazhdim i stileve të temës (dpt-doc-page, dpt-doc-panel, view-btn,
   kalendari-empty, dpt-list). Harmonikat ndjekin tax-offices-accordion.
   ========================================= */

.fj-page {
    --fj-red: #ce2127;
    --fj-red-dark: #a91b20;
    --fj-red-wash: #fdf2f2;
    --fj-line: #e5e5e5;
    --fj-ink: #222;
    --fj-muted: #6c757d;
}


/* =========================================
   SHIRITI I KËRKIMIT
   ========================================= */

.fj-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: 24px;
}

.admin-bar .fj-toolbar {
    top: 32px;
}

.fj-toolbar.is-stuck {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.fj-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 24px;
}

.fj-search {
    flex: 1 1 420px;
    min-width: 0;
}

.fj-page .form-label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    padding: 0;
    float: none;
    width: auto;
}

.fj-search-field {
    position: relative;
}

.fj-search-field .bi {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fj-red);
    font-size: 15px;
    pointer-events: none;
}

.fj-search-field .form-control {
    height: 42px;
    padding-left: 36px;
    font-size: 15px;
}

.fj-page .form-control:focus {
    border-color: var(--fj-red);
    box-shadow: 0 0 0 0.2rem rgba(206, 33, 39, 0.15);
}

.fj-hint {
    margin: 6px 0 0;
    color: var(--fj-muted);
    font-size: 13px;
}


/* Renditja: anglisht / shqip */

.fj-order {
    margin: 0;
    padding: 0;
    border: 0;
}

.fj-segmented {
    display: inline-flex;
    border: 1px solid var(--fj-red);
    border-radius: 6px;
    overflow: hidden;
}

.fj-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fj-segmented label {
    margin: 0;
    padding: 0 18px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--fj-red);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.fj-segmented label + input + label {
    border-left: 1px solid var(--fj-red);
}

.fj-segmented input:checked + label {
    background: var(--fj-red);
    color: #fff;
}

.fj-segmented input:focus-visible + label {
    outline: 2px solid #111;
    outline-offset: -4px;
}


/* Shkronjat */

.fj-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--fj-line);
}

.fj-letters[hidden] {
    display: none;
}

.fj-letter {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--fj-line);
    border-radius: 4px;
    background: #fff;
    color: var(--fj-red);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fj-letter:hover:not(:disabled) {
    border-color: var(--fj-red);
    background: var(--fj-red-wash);
}

.fj-letter.is-active {
    background: var(--fj-red);
    border-color: var(--fj-red);
    color: #fff;
}

.fj-letter:disabled {
    color: #c4c9ce;
    background: #fafafa;
    cursor: default;
}

.fj-letter:focus-visible {
    outline: 2px solid #111;
    outline-offset: 1px;
}


/* Numri i termave dhe butonat */

.fj-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.fj-status {
    margin: 0;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fj-bulk {
    display: flex;
    gap: 8px;
}

.fj-bulk .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}


/* =========================================
   TERMAT (harmonikë)
   ========================================= */

.fj-list {
    margin-bottom: 30px;
}

.fj-entry {
    background: #fff;
    border: 1px solid var(--fj-line);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    scroll-margin-top: 260px;
}

.fj-entry[hidden] {
    display: none;
}

.fj-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 14px 20px;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.fj-summary::-webkit-details-marker {
    display: none;
}

.fj-summary:hover {
    background: #fafafa;
}

.fj-summary:focus-visible {
    outline: 2px solid var(--fj-red);
    outline-offset: -2px;
}

.fj-terms {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    row-gap: 2px;
}

.fj-term-en {
    order: 1;
    color: #111;
    font-size: 17px;
    font-weight: 700;
}

.fj-sep {
    order: 2;
    color: #b0b6bc;
}

.fj-term-sq {
    order: 3;
    color: var(--fj-red);
    font-size: 16px;
    font-weight: 600;
}

/* Renditja shqip: termi shqip del i pari */
.fj-list.is-sq .fj-term-sq {
    order: 1;
    color: #111;
    font-size: 17px;
    font-weight: 700;
}

.fj-list.is-sq .fj-term-en {
    order: 3;
    color: var(--fj-red);
    font-size: 16px;
    font-weight: 600;
}

.fj-term mark {
    padding: 0 2px;
    border-radius: 2px;
    background: #ffe39a;
    color: inherit;
}

.fj-match {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.fj-chevron {
    flex: none;
    color: var(--fj-red);
    font-size: 16px;
    transition: transform 0.2s ease;
}

/* E hapur: si harmonika e zyrave tatimore */
.fj-entry[open] > .fj-summary {
    background: var(--fj-red);
}

.fj-entry[open] > .fj-summary .fj-term,
.fj-entry[open] > .fj-summary .fj-sep,
.fj-entry[open] > .fj-summary .fj-chevron {
    color: #fff;
}

.fj-entry[open] > .fj-summary .fj-chevron {
    transform: rotate(180deg);
}

.fj-entry[open] > .fj-summary .fj-match {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fj-entry[open] > .fj-summary mark {
    background: rgba(255, 255, 255, 0.3);
}

.fj-entry.is-flash {
    animation: fj-flash 1.6s ease;
}

@keyframes fj-flash {
    0%, 30% { box-shadow: 0 0 0 4px rgba(206, 33, 39, 0.35); }
    100%    { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
}


/* =========================================
   SHPJEGIMI
   ========================================= */

.fj-body {
    padding: 22px 24px 18px;
    border-top: 1px solid #eee;
    color: #444;
    font-size: 16px;
    line-height: 1.75;
}

.fj-body > p {
    margin: 0 0 14px;
    text-align: justify;
    hyphens: auto;
}

.fj-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 6px;
    color: #777;
    font-size: 13px;
    font-weight: 700;
}

.fj-aliases {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    text-align: left !important;
}

.fj-alias {
    padding: 3px 10px;
    border: 1px solid #f1c4c6;
    border-radius: 999px;
    background: #fff4f4;
    color: #9f171c;
    font-size: 13px;
    line-height: 1.5;
}

.fj-sense {
    position: relative;
    padding-left: 38px;
}

.fj-sense-no {
    position: absolute;
    left: 0;
    top: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--fj-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

.fj-items {
    margin: 0 0 16px;
}

.fj-items li {
    font-size: 16px;
    margin-bottom: 6px;
}

.fj-bib {
    margin: 4px 0 14px;
    padding: 14px 18px;
    background: #fafafa;
    border-left: 3px solid var(--fj-red);
    border-radius: 0 5px 5px 0;
}

.fj-bib p {
    margin: 4px 0 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.fj-see {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
}

.fj-ref {
    display: inline-flex;
    padding: 4px 11px;
    border: 1px solid #e3e3e3;
    border-left: 3px solid var(--fj-red);
    border-radius: 4px;
    background: #fff;
    color: #333 !important;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

a.fj-ref:hover,
a.fj-ref:focus {
    background: var(--fj-red);
    border-color: var(--fj-red);
    color: #fff !important;
}

.fj-ref.is-plain {
    border-left-color: #c4c9ce;
    color: #666 !important;
}

.fj-permalink {
    margin: 6px 0 0 !important;
    padding-top: 12px;
    border-top: 1px dashed var(--fj-line);
    font-size: 13px;
    text-align: right !important;
}

.fj-permalink a {
    color: var(--fj-red) !important;
    font-weight: 600;
}

.fj-permalink a.is-copied {
    color: #1f7a4d !important;
}


/* =========================================
   GJENDJE BOSH DHE BURIMI
   ========================================= */

.fj-empty {
    margin-bottom: 30px;
}

.fj-empty[hidden] {
    display: none;
}

.fj-linklike {
    padding: 0;
    border: 0;
    background: none;
    color: var(--fj-red);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.fj-source {
    margin: 10px 0 0;
    color: var(--fj-muted);
    font-size: 13px;
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 767.98px) {

    /* Në celular mbetet ngjitur vetëm fusha e kërkimit, jo i gjithë paneli. */
    .fj-toolbar {
        position: static;
    }

    .fj-letters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
        scrollbar-color: #ce2127 #eeeeee;
    }

    .fj-letter {
        flex: none;
    }

    .fj-order,
    .fj-segmented {
        width: 100%;
    }

    .fj-segmented label {
        flex: 1 1 0;
        justify-content: center;
    }

    .fj-summary {
        padding: 12px 14px;
        gap: 10px;
    }

    .fj-term-en,
    .fj-list.is-sq .fj-term-sq {
        font-size: 15px;
    }

    .fj-term-sq,
    .fj-list.is-sq .fj-term-en {
        font-size: 14px;
    }

    .fj-sep {
        display: none;
    }

    .fj-terms {
        flex-direction: column;
    }

    .fj-match {
        display: none;
    }

    .fj-body {
        padding: 18px 16px 14px;
        font-size: 15px;
        line-height: 1.65;
    }

    .fj-body > p {
        text-align: left;
    }

    .fj-items li {
        font-size: 15px;
    }

    .fj-entry {
        scroll-margin-top: 20px;
    }
}


/* =========================================
   PRINTIMI
   ========================================= */

@media print {
    .fj-toolbar,
    .fj-permalink,
    .fj-chevron,
    .fj-empty {
        display: none !important;
    }

    .fj-entry {
        break-inside: avoid;
        box-shadow: none;
    }

    .fj-entry[open] > .fj-summary {
        background: none;
    }

    .fj-entry[open] > .fj-summary .fj-term-en {
        color: #000;
    }

    .fj-entry[open] > .fj-summary .fj-term-sq {
        color: var(--fj-red);
    }
}


@media (prefers-reduced-motion: reduce) {
    .fj-entry.is-flash {
        animation: none;
    }

    .fj-chevron,
    .fj-summary {
        transition: none;
    }
}


/* =========================================
   ACCESSIBILITY CONTRAST MODE
   ========================================= */

.accessibility__contrast .fj-entry,
.accessibility__contrast .fj-letter,
.accessibility__contrast .fj-bib,
.accessibility__contrast .fj-ref {
    background: #282828;
    color: #fff !important;
}

.accessibility__contrast .fj-term-en,
.accessibility__contrast .fj-body,
.accessibility__contrast .fj-bib p,
.accessibility__contrast .fj-status,
.accessibility__contrast .fj-hint {
    color: #fff;
}
