/* ═══════════════════════════════════════════════════════════════
   LAWT — Paragraph Timeline (Χρονολόγιο αλλαγών)
   Standalone styles — safe to remove without affecting core LAWT.
   Class prefix: .lawt-pt-*
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay (full-screen backdrop) ── */
.lawt-pt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}
.lawt-pt-overlay.is-open {
    display: flex;
    animation: lawtPtFadeIn 180ms ease-out;
}
@keyframes lawtPtFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal container ── */
.lawt-pt-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.lawt-pt-modal *,
.lawt-pt-modal *::before,
.lawt-pt-modal *::after {
    box-sizing: border-box;
}
.lawt-pt-modal button {
    font-family: inherit;
    box-sizing: border-box;
}

/* ── Header ── */
.lawt-pt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e6ea;
    flex-shrink: 0;
}
.lawt-pt-title-block {
    flex: 1;
    min-width: 0;
}
.lawt-pt-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a2733;
    margin: 0 0 3px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lawt-pt-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lawt-pt-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.lawt-pt-ctrl {
    background: #fff;
    border: 1px solid #d0d7de;
    color: #444;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
    transition: all 120ms ease;
    white-space: nowrap;
}
.lawt-pt-ctrl:hover {
    background: #f6f8fa;
    border-color: #85B7EB;
    color: #1a5490;
}
.lawt-pt-ctrl.is-active {
    background: #85B7EB;
    border-color: #85B7EB;
    color: #fff;
}
.lawt-pt-ctrl i {
    margin-right: 4px;
}
.lawt-pt-close {
    background: transparent;
    border: 1px solid transparent;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 120ms ease;
}
.lawt-pt-close:hover {
    background: #f1f3f5;
    color: #1a2733;
}

/* ── Body (scrollable — single scroll for the whole timeline) ── */
.lawt-pt-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px 24px;
    display: flex;
    gap: 0;
    scrollbar-width: thin;                  /* Firefox */
    scrollbar-color: #c4ccd4 transparent;   /* Firefox */
}

/* Subtle scrollbar (Webkit / Chromium / Safari) */
.lawt-pt-body::-webkit-scrollbar {
    width: 10px;
}
.lawt-pt-body::-webkit-scrollbar-track {
    background: transparent;
}
.lawt-pt-body::-webkit-scrollbar-thumb {
    background: #c4ccd4;
    border-radius: 5px;
    border: 2px solid #fff;
    background-clip: padding-box;
}
.lawt-pt-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    background-clip: padding-box;
    border: 2px solid #fff;
}

/* Loading / empty / error states */
.lawt-pt-loading,
.lawt-pt-empty,
.lawt-pt-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}
.lawt-pt-loading i,
.lawt-pt-empty i,
.lawt-pt-error i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #b0b8c1;
}
.lawt-pt-loading i {
    animation: lawtPtSpin 1s linear infinite;
}
@keyframes lawtPtSpin {
    to { transform: rotate(360deg); }
}

/* ── Rail (vertical timeline) ── */
.lawt-pt-rail {
    width: 28px;
    flex-shrink: 0;
    position: relative;
    padding-top: 24px;
}
.lawt-pt-rail-line {
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 24px;
    width: 2px;
    background: #d0d7de;
}
.lawt-pt-rail-dot {
    position: absolute;
    left: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #888780;
    transition: all 150ms ease;
}
.lawt-pt-rail-dot.is-active {
    left: 6px;
    width: 16px;
    height: 16px;
    background: #1D9E75;
    border-color: #1D9E75;
}

/* ── Cards container ── */
.lawt-pt-cards {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lawt-pt-cards.is-reversed {
    flex-direction: column-reverse;
}

/* ── Card ── */
.lawt-pt-card {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.lawt-pt-card > .lawt-pt-card-header {
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
}
.lawt-pt-card > .lawt-pt-card-footer:last-child {
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
}
.lawt-pt-card > .lawt-pt-card-body:last-child {
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
}

.lawt-pt-card.is-active {
    border-color: #1D9E75;
}
.lawt-pt-card.is-diff-on {
    border-color: #85B7EB;
    box-shadow: 0 0 0 1px #B5D4F4 inset;
}

/* Card header */
.lawt-pt-card-header {
    padding: 11px 16px;
    background: #f2f5f7;
    border-bottom: 1px solid #e2e6ea;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lawt-pt-card.is-active > .lawt-pt-card-header {
    background: #e8f5ee;
    border-bottom-color: #c8e6d4;
}
.lawt-pt-card.is-diff-on > .lawt-pt-card-header {
    background: #e6f1fb;
    border-bottom-color: #B5D4F4;
}
.lawt-pt-card-num {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
}
.lawt-pt-card.is-active .lawt-pt-card-num {
    color: #085041;
}
.lawt-pt-card.is-diff-on .lawt-pt-card-num {
    color: #0C447C;
}
.lawt-pt-card-label {
    font-size: 13px;
    color: #1a2733;
    flex: 1;
    min-width: 0;
}
.lawt-pt-card.is-active .lawt-pt-card-label {
    color: #04342C;
    font-weight: 500;
}
.lawt-pt-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    background: #1D9E75;
    color: #fff;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    line-height: 1.4;
}
.lawt-pt-card-noprev {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    flex-shrink: 0;
}
.lawt-pt-card-actions {
    margin-left: auto;
    flex-shrink: 0;
}
.lawt-pt-diff-toggle {
    background: #fff;
    border: 1px solid #85B7EB;
    color: #1a5490;
    padding: 5px 11px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
    transition: all 120ms ease;
    white-space: nowrap;
}
.lawt-pt-diff-toggle:hover {
    background: #e6f1fb;
}
.lawt-pt-card.is-diff-on .lawt-pt-diff-toggle {
    background: #185FA5;
    border-color: #185FA5;
    color: #fff;
}
.lawt-pt-diff-toggle i {
    margin-right: 3px;
}

/* Mini legend (shown only when diff-on) */
.lawt-pt-card-legend {
    padding: 7px 16px;
    font-size: 11px;
    color: #0C447C;
    background: #f0f7fd;
    border-bottom: 1px solid #e2e6ea;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.lawt-pt-card-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.lawt-pt-card-legend .legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.lawt-pt-card-legend .legend-swatch.added {
    background: #C0DD97;
}
.lawt-pt-card-legend .legend-swatch.removed {
    background: #F7C1C1;
}

/* Card body */
.lawt-pt-card-body {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #1a2733;
    word-wrap: break-word;
}
.lawt-pt-card-body p {
    margin: 0 0 0.6em;
}
.lawt-pt-card-body p:last-child {
    margin-bottom: 0;
}

/* Diff highlights (the spans we converted from <ins>/<del>) */
.lawt-pt-card-body .lawt-pt-added {
    background: #C0DD97;
    color: #173404;
    padding: 0 3px;
    border-radius: 2px;
    text-decoration: none;
}
.lawt-pt-card-body .lawt-pt-removed {
    background: #F7C1C1;
    color: #501313;
    padding: 0 3px;
    border-radius: 2px;
    text-decoration: line-through;
}

/* Card footer (comments + source) */
.lawt-pt-card-footer {
    padding: 10px 16px 12px;
    background: #f2f5f7;
    border-top: 1px dashed #d0d7de;
    font-size: 12px;
    color: #444441;
    line-height: 1.5;
}
.lawt-pt-card-footer:empty {
    display: none;
}
.lawt-pt-comments,
.lawt-pt-source {
    margin-bottom: 4px;
}
.lawt-pt-comments:last-child,
.lawt-pt-source:last-child {
    margin-bottom: 0;
}
.lawt-pt-card-footer strong {
    font-weight: 600;
    color: #1a2733;
    margin-right: 4px;
}
.lawt-pt-card-footer a {
    color: #1a5490;
    text-decoration: none;
}
.lawt-pt-card-footer a:hover {
    text-decoration: underline;
}

/* ── Body lock when modal is open (set by JS on <body>) ── */
body.lawt-pt-modal-open {
    overflow: hidden;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .lawt-pt-overlay {
        padding: 0;
    }
    .lawt-pt-modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .lawt-pt-header {
        padding: 12px 14px;
        flex-wrap: wrap;
    }
    .lawt-pt-title {
        white-space: normal;
    }
    .lawt-pt-subtitle {
        white-space: normal;
    }
    .lawt-pt-controls {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin-top: 4px;
    }
    .lawt-pt-ctrl {
        font-size: 11px;
        padding: 5px 9px;
    }
    .lawt-pt-body {
        padding: 14px;
    }
    .lawt-pt-rail {
        display: none;
    }
    .lawt-pt-card-header {
        padding: 10px 12px;
    }
    .lawt-pt-card-body,
    .lawt-pt-card-footer {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ── Print ── */
@media print {
    .lawt-pt-overlay {
        display: none !important;
    }
}