/* css/ticket-share.css — full-screen single-ticket view (shareable deep link).
   App is dark by default; light via html[data-theme="light"]. */

.tsv-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    flex-direction: column;
    background: #0b1120;
    color: #f1f5f9;
}
.tsv-overlay.open { display: flex; }
body.tsv-open { overflow: hidden; }

/* The full-screen view hosts the REAL ticket card. Its own Open/Copy buttons in
   the tab row are redundant here (the top bar provides Back + Copy), so hide them. */
.tsv-body .ticket-detail-tab-actions { display: none !important; }

/* While the full-screen view is open, app modals + toasts must appear ABOVE it
   (e.g. "not on shift", the link-ticket modal, copy confirmation) — they live in
   the normal app layer which is below the overlay's z-index otherwise. */
body.tsv-open #notification-panel,
body.tsv-open .modal,
body.tsv-open [class*="-modal-backdrop"],
body.tsv-open .reaction-tooltip { z-index: 2147483600 !important; }

.tsv-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 14px;
    background: #111827;
    border-bottom: 1px solid #1f2937;
}
.tsv-back, .tsv-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #1f2937;
    background: #0b1120;
    color: #e5e7eb;
    border-radius: 9px;
    padding: 7px 12px;
    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer;
}
.tsv-back:hover, .tsv-share:hover { border-color: #6366f1; color: #fff; }
.tsv-share { margin-left: auto; background: #6366f1; border-color: #6366f1; color: #fff; }
.tsv-share:hover { background: #4f46e5; }
.tsv-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    color: #f1f5f9;
}

.tsv-scroll { flex: 1 1 auto; overflow-y: auto; padding: 22px 20px 48px; }

/* Two-column "big ticketing system" layout: conversation left, properties
   sidebar right. Sidebar stacks below the card on narrow screens. */
.tsv-body {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.tsv-main { flex: 1 1 auto; min-width: 0; }
.tsv-side {
    flex: 0 0 300px;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tsv-side[hidden] { display: none; }

.tsv-panel {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 14px 16px;
}
.tsv-panel-title {
    font: 700 11px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 10px;
}
.tsv-prop { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; }
.tsv-prop + .tsv-prop { border-top: 1px solid rgba(148, 163, 184, 0.08); }
.tsv-prop-label {
    flex: 0 0 92px;
    font-size: 11px;
    color: #94a3b8;
}
.tsv-prop-value {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #e5e7eb;
    overflow-wrap: anywhere;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.tsv-muted { color: #94a3b8; font-weight: 500; }
.tsv-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 500; }
.tsv-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}
.tsv-chip--open { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); }
.tsv-chip--done { background: rgba(34, 197, 94, 0.14); color: #4ade80; border-color: rgba(34, 197, 94, 0.35); }
.tsv-chip--pri-low { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.3); }
.tsv-chip--pri-medium { background: rgba(59, 130, 246, 0.14); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.tsv-chip--pri-high { background: rgba(249, 115, 22, 0.14); color: #fdba74; border-color: rgba(249, 115, 22, 0.35); }
.tsv-chip--pri-urgent { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.tsv-tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Roomier reading inside the full-screen card */
.tsv-main .ticket-card { padding: 20px 22px; }
.tsv-main .tc-ticket-subject { font-size: 16px !important; line-height: 1.4 !important; }
.tsv-main .email-message-html { font-size: 13.5px; line-height: 1.55; }

@media (max-width: 1100px) {
    .tsv-body { flex-direction: column; }
    .tsv-side { position: static; flex-basis: auto; width: 100%; }
}
.tsv-state {
    max-width: 560px;
    margin: 64px auto;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1.6;
}

/* The hosted (real) ticket card fills the overlay column. */
.tsv-body .ticket-card { width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

/* Light theme */
html[data-theme="light"] .tsv-overlay { background: #f5f7fa; color: #0f172a; }
html[data-theme="light"] .tsv-topbar { background: #ffffff; border-bottom-color: #e2e8f0; }
html[data-theme="light"] .tsv-back, html[data-theme="light"] .tsv-share { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
html[data-theme="light"] .tsv-share { background: #4f46e5; border-color: #4f46e5; color: #fff; }
html[data-theme="light"] .tsv-title { color: #0f172a; }
html[data-theme="light"] .tsv-state { color: #64748b; }
html[data-theme="light"] .tsv-body .ticket-card { box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12); }
html[data-theme="light"] .tsv-panel { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .tsv-panel-title { color: #64748b; }
html[data-theme="light"] .tsv-prop + .tsv-prop { border-top-color: rgba(15, 23, 42, 0.07); }
html[data-theme="light"] .tsv-prop-label { color: #64748b; }
html[data-theme="light"] .tsv-prop-value { color: #0f172a; }
html[data-theme="light"] .tsv-muted { color: #94a3b8; }
html[data-theme="light"] .tsv-chip--open { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
html[data-theme="light"] .tsv-chip--done { background: #dcfce7; color: #166534; border-color: #86efac; }
html[data-theme="light"] .tsv-chip--pri-low { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
html[data-theme="light"] .tsv-chip--pri-medium { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
html[data-theme="light"] .tsv-chip--pri-high { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
html[data-theme="light"] .tsv-chip--pri-urgent { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
html[data-theme="light"] .tsv-tag { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }

/* Tiny copy confirmation (brief, ~1s) */
.tsv-minitoast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 2147483647;
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.tsv-minitoast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
    .tsv-back span, .tsv-share span { display: none; }
    .tsv-share { padding: 8px; }
    .tsv-back { padding: 8px; }
    .tsv-scroll { padding: 14px 8px 40px; }
}
