/* Wireframe runtime: breadcrumb + commenting overlay
 * Adaptováno z projektu krotka (PhpstormProjects/krotka/wireframe.css).
 * Lobaro varianta — bez auth-gate (review otevřený, jméno z localStorage). */

/* ----- Breadcrumb (zatím nepoužité, ponecháno pro paritu) ----- */
.wf-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wf-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wf-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wf-breadcrumb li:not(:last-child)::after {
    content: '›';
    color: #94a3b8;
    font-weight: 600;
    margin-left: 4px;
}

.wf-breadcrumb a {
    color: #2c5282;
    text-decoration: none;
}

.wf-breadcrumb a:hover { text-decoration: underline; }
.wf-breadcrumb [aria-current="page"] { color: #1e293b; font-weight: 600; }

@media (min-width: 768px) {
    .wf-breadcrumb { padding: 14px 24px; font-size: 14px; }
}

/* ----- Comment dialog ----- */
.wf-comment-dialog .wf-error {
    color: #b91c1c;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

/* ----- Thread layout ----- */
.wf-thread-dialog {
    width: 360px;
    max-width: calc(100vw - 24px);
}

.wf-thread-items {
    margin: 10px 0;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wf-thread-items:empty { display: none; }

.wf-thread-item {
    background: #fffdf2;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 8px 10px;
}

.wf-thread-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #78350f;
    margin-bottom: 4px;
}

.wf-thread-author { font-weight: 700; color: #422006; }

.wf-thread-date {
    color: #92400e;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 10px;
    flex: 1;
}

.wf-thread-delete {
    background: transparent;
    border: 1px solid #b91c1c;
    color: #b91c1c;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wf-thread-delete:hover { background: #fee2e2; }

.wf-thread-text {
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.wf-thread-reply {
    border-top: 1px solid #fde68a;
    padding-top: 10px;
    margin-top: 6px;
}

/* ----- Review bar (sticky proužek nahoře) ----- */
.wf-review-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    background:
        repeating-linear-gradient(
            135deg,
            #422006 0,
            #422006 12px,
            #78350f 12px,
            #78350f 24px
        );
    color: #fef3c7;
    border-bottom: 2px solid #fbbf24;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    font-size: 13px;
}

.wf-review-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 0;
}

.wf-review-bar-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wf-review-bar-label::before {
    content: '🛠️';
    font-size: 16px;
}

.wf-review-bar-user {
    font-weight: 600;
    color: #fef3c7;
    font-size: 12px;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wf-review-bar-user button {
    background: transparent;
    border: 1px dashed rgba(254, 243, 199, 0.4);
    color: #fef3c7;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.wf-review-bar-user button:hover {
    background: rgba(254, 243, 199, 0.1);
}

.wf-comment-toggle {
    background: #fbbf24;
    color: #422006;
    border: 1px solid #fbbf24;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wf-comment-toggle:hover { background: #fcd34d; }

.wf-comment-toggle[aria-pressed="true"] {
    background: #f59e0b;
    color: #1c1917;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wf-comment-count {
    background: #b91c1c;
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

@media (max-width: 600px) {
    .wf-review-bar-label { font-size: 11px; }
    .wf-review-bar-label .wf-review-bar-tagline { display: none; }
}

/* ----- Commenting mode visual cues ----- */
body.wf-commenting-on { cursor: crosshair; }

body.wf-commenting-on .wf-commentable-hover {
    outline: 2px dashed #d97706;
    outline-offset: 2px;
    cursor: pointer;
    background-color: rgba(254, 240, 138, 0.18);
}

/* Markers — pin attached to element with comment */
.wf-comment-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    background: #b91c1c;
    color: white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    transition: transform 0.15s ease;
}

.wf-comment-marker:hover { transform: rotate(-45deg) scale(1.15); }
.wf-comment-marker span { transform: rotate(45deg); }

/* Comment input dialog */
.wf-comment-dialog {
    position: absolute;
    width: 320px;
    background: #fef9c3;
    border: 1px solid #ca8a04;
    border-left: 4px solid #ca8a04;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 14px;
    border-radius: 4px;
    z-index: 10000;
    font-size: 14px;
}

.wf-comment-dialog h4 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #78350f;
    font-weight: 700;
}

.wf-comment-dialog .wf-target-info {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 11px;
    color: #92400e;
    background: rgba(202, 138, 4, 0.12);
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
    word-break: break-all;
}

.wf-comment-dialog input[type="text"] {
    width: 100%;
    border: 1px solid #d4a90e;
    border-radius: 4px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 13px;
    background: white;
    color: #422006;
    margin-bottom: 8px;
}

.wf-comment-dialog input[type="text"]:focus,
.wf-comment-dialog textarea:focus {
    outline: 2px solid #ca8a04;
    outline-offset: 1px;
}

.wf-comment-dialog textarea {
    width: 100%;
    min-height: 90px;
    border: 1px solid #d4a90e;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    background: white;
    color: #422006;
}

.wf-comment-dialog .wf-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.wf-comment-dialog button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}

.wf-comment-dialog .wf-save {
    background: #ca8a04;
    color: white;
    border-color: #a16207;
}

.wf-comment-dialog .wf-save:hover { background: #a16207; }

.wf-comment-dialog .wf-cancel {
    background: white;
    color: #422006;
    border-color: #ca8a04;
}

.wf-comment-dialog .wf-cancel:hover { background: #fef3c7; }

/* Hint banner when commenting mode is active */
.wf-comment-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #422006;
    color: #fef3c7;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: none;
}

body.wf-commenting-on .wf-comment-hint { display: block; }

/* ----- Resolved feature ----- */

/* Filter toggle pill v review baru (vedle Komentovat) */
.wf-resolved-toggle {
    background: transparent;
    color: #fef3c7;
    border: 1px dashed rgba(254, 243, 199, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wf-resolved-toggle:hover { background: rgba(254, 243, 199, 0.1); }

.wf-resolved-toggle[aria-pressed="false"] {
    opacity: 0.7;
    text-decoration: line-through;
}

/* Marker — všechna vlákna vyřešená (zelená) */
.wf-comment-marker--resolved {
    background: #16a34a;
    opacity: 0.7;
}

.wf-comment-marker--resolved:hover { opacity: 1; }

/* Marker — kombinace resolved + open (modrá s malou zelenou tečkou) */
.wf-comment-marker--mixed {
    background: #2563eb;
    position: relative;
}

.wf-comment-marker--mixed::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #16a34a;
    border: 2px solid white;
    border-radius: 50%;
    transform: rotate(45deg);
}

/* Resolve / unresolve tlačítko v thread itemu */
.wf-thread-resolve {
    background: transparent;
    border: 1px solid #16a34a;
    color: #166534;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.wf-thread-resolve:hover { background: #dcfce7; }

.wf-thread-resolve[data-resolved="1"] {
    border-color: #92400e;
    color: #92400e;
}

.wf-thread-resolve[data-resolved="1"]:hover { background: #fef3c7; }

/* Thread item ve stavu resolved (snížená opacity) */
.wf-thread-item--resolved {
    opacity: 0.65;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.wf-thread-item--resolved .wf-thread-text {
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.3);
}

/* Badge "✓ vyřešeno · datum · jméno" pod komentem */
.wf-thread-resolved {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #bbf7d0;
    color: #166534;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Print: hide all wireframe runtime UI */
@media print {
    .wf-breadcrumb,
    .wf-review-bar,
    .wf-comment-toggle,
    .wf-comment-marker,
    .wf-comment-dialog,
    .wf-comment-hint {
        display: none !important;
    }
}
