/*
 * STYLES OF THE TICKET SERVICE PAGES.
 * NOTE: THE "TKT-" AND "PS-" RULES ARE COPIED FROM core-app/resources/views/ticketing/partials/styles.blade.php AND
 * ticketing/public/summary.blade.php SO THE TICKET PAGE LOOKS EXACTLY LIKE THE LARAVEL PUBLIC VIEW. KEEP THEM IN SYNC.
 * THE "SV-" RULES BELONG TO THIS APP ONLY (SEARCH PAGE, LOADING, AND ERROR STATES).
 */

/* SHARED TICKETING STYLES (FROM styles.blade.php) */
.tkt-page { font-family: 'Inter', sans-serif; color: #1A233A; display: flex; flex-direction: column; gap: 1.5rem; }
.tkt-page .material-symbols-outlined { font-size: 1rem; }
.tkt-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.85rem;
    padding: 0.55rem 1.1rem; border-radius: 9px; border: 1px solid transparent; text-decoration: none; cursor: pointer; }
.tkt-btn-accent { background: #ee6920; color: #fff; }
.tkt-btn-accent:hover { background: #d85a15; color: #fff; }
.tkt-btn-light { background: #fff; color: #475569; border-color: #e2e8f0; }
.tkt-btn-light:hover { background: #f8fafc; color: #1A233A; }
.tkt-card { background: #fff; border-radius: 14px; border: 1px solid #f1f5f9; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); overflow: hidden; }
.tkt-card-header { padding: 0.9rem 1.25rem; border-bottom: 1px solid #f1f5f9; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.9rem; color: #2a2f45; display: flex; align-items: center; gap: 0.5rem; }
.tkt-card-body { padding: 1.25rem; }
.tkt-muted { color: #64748b; font-size: 0.78rem; }

/* PUBLIC SUMMARY PAGE (FROM summary.blade.php) */
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: #1A233A;
    background-color: #f5f1ec;
    /* NOTE: A SOFT DOT PATTERN AND WARM GLOWS KEEP THE APP BACKGROUND COLOR WITHOUT LOOKING PLAIN */
    background-image:
        radial-gradient(rgba(42, 47, 69, 0.09) 1px, transparent 1px),
        radial-gradient(700px 420px at 100% 30%, rgba(238, 105, 32, 0.12), transparent 70%),
        radial-gradient(640px 420px at 0% 85%, rgba(42, 47, 69, 0.08), transparent 70%);
    background-size: 20px 20px, auto, auto;
    -webkit-font-smoothing: antialiased;
}

/* HEADER BAND: SAME NAVY GRADIENT AND ORANGE UNDERLINE AS THE APPLICATION BANNERS */
.ps-header { position: relative; overflow: hidden; background: linear-gradient(135deg, #2a2f45 0%, #3a4163 100%); color: #fff; padding: 1.25rem 1rem 6rem; }
.ps-header::before { content: ''; position: absolute; width: 520px; height: 520px; right: -180px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(238, 105, 32, 0.32) 0%, rgba(238, 105, 32, 0.08) 45%, transparent 70%); }
.ps-header::after { content: ''; position: absolute; width: 260px; height: 260px; left: -90px; bottom: -150px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); }
.ps-header-inner { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; }
.ps-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #ee6920, #f8c3a5); z-index: 1; }

.ps-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ps-brand { display: flex; align-items: center; gap: 0.7rem; }
.ps-brand img { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 5px; }
.ps-brand-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1rem; }
.ps-brand-caption { font-size: 0.74rem; color: rgba(255, 255, 255, 0.6); }
.ps-validity { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 9px; font-size: 0.78rem; font-weight: 600; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); }
.ps-validity .material-symbols-outlined { color: #f8c3a5; font-size: 1.05rem; }

.ps-hero-type { display: inline-block; font-size: 0.8rem; font-weight: 600; color: #f8c3a5; letter-spacing: 0.02em; }
.ps-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.2; margin: 0.35rem 0 0.5rem; word-break: break-word; }
/* CONTENT */
.ps-content { position: relative; z-index: 2; max-width: 920px; margin: -4.25rem auto 0; padding: 0 1rem 2.5rem; display: grid; gap: 1.25rem; }
.ps-content > * { min-width: 0; }
.ps-card { animation: ps-rise 0.45s ease both; }
.ps-card .tkt-card-header .material-symbols-outlined { color: #ee6920; font-size: 1.15rem; }

/* STATUS OVERVIEW: A PLAIN CARD WITH THE STATUS, THE PROGRESS TRACK, AND THE KEY FACTS IN ONE ROW BELOW */
.ps-status { background: #fff; border: 1px solid #e8eaf0; border-radius: 16px; box-shadow: 0 8px 20px rgba(42, 47, 69, 0.1); overflow: hidden; animation: ps-rise 0.45s ease both; }
.ps-status-body { padding: 1.5rem 1.75rem 1.6rem; }
.ps-status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.ps-kicker { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.8rem; color: #64748b; margin: 0; }
.ps-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.78rem; color: #64748b; letter-spacing: 0.02em; }
.ps-status-label { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; color: #1A233A; margin: 0.35rem 0; }
.ps-status-text { font-size: 0.9rem; color: #475569; margin: 0; max-width: 52ch; line-height: 1.5; }
.ps-sla-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.ps-sla-badge .material-symbols-outlined { font-size: 1.05rem; }
.ps-sla-met { background: #dcfce7; color: #15803d; }
.ps-sla-not-met { background: #fee2e2; color: #b91c1c; }
.ps-sla-paused { background: #fdf0e9; color: #ee6920; }
.ps-sla-running { background: #e7e9f2; color: #2a2f45; }
.ps-sla-skipped { background: #f1f5f9; color: #64748b; }

/* SERVICE LEVEL: RESPONSE AND RESOLUTION TIME SIDE BY SIDE, STACKED ON SMALL SCREENS */
.ps-sla-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.ps-sla-stage { border: 1px solid #eef0f4; border-radius: 12px; padding: 1rem 1.1rem; background: #fafbfc; min-width: 0; }
.ps-sla-stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.ps-sla-stage-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.95rem; color: #1A233A; margin: 0; }
.ps-sla-stage-caption { font-size: 0.74rem; color: #64748b; margin: 0.15rem 0 0; }
.ps-sla-stage .ps-sla-badge { padding: 0.25rem 0.65rem; font-size: 0.72rem; }
.ps-sla-value { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.35rem; color: #1A233A; margin: 0.85rem 0 0.6rem; }
.ps-sla-rows { margin: 0; display: grid; gap: 0.4rem; }
.ps-sla-rows div { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.8rem; border-top: 1px dashed #e2e8f0; padding-top: 0.4rem; }
.ps-sla-rows dt { color: #64748b; }
.ps-sla-rows dd { margin: 0; font-weight: 600; text-align: right; }
.ps-sla-note { font-size: 0.74rem; color: #64748b; margin: 0.75rem 0 0; }

.ps-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid #eef0f4; background: #fafbfc; }
.ps-fact { padding: 0.9rem 1.75rem; border-right: 1px solid #eef0f4; }
.ps-fact:last-child { border-right: 0; }
.ps-fact dt { font-size: 0.72rem; color: #7b8496; margin: 0 0 2px; }
.ps-fact dd { margin: 0; font-weight: 700; font-size: 0.9rem; color: #1A233A; }
.ps-fact dd small { display: block; font-weight: 500; font-size: 0.74rem; color: #64748b; }

.ps-track { list-style: none; margin: 0; padding: 1.6rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.ps-track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-align: center; font-size: 0.78rem; font-weight: 600; color: #a0a8b8; }
.ps-track li::before { content: ''; position: absolute; top: 17px; right: 50%; width: 100%; height: 3px; background: #e7e9ef; }
.ps-track li:first-child::before { display: none; }
.ps-track li.is-done::before, .ps-track li.is-current::before { background: #2a2f45; }
.ps-track-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f3f7; color: #a0a8b8; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.85rem; border: 3px solid #fff; }
.ps-track-dot .material-symbols-outlined { font-size: 1.1rem; }
.ps-track li.is-done { color: #2a2f45; }
.ps-track li.is-done .ps-track-dot { background: #2a2f45; color: #fff; }
.ps-track li.is-current { color: #1A233A; font-weight: 800; }
.ps-track li.is-current .ps-track-dot { background: #ee6920; color: #fff; box-shadow: 0 0 0 5px rgba(238, 105, 32, 0.28); }

/* DISCUSSION AS A LIST: ONE ROW PER COMMENT, OLDEST FIRST, WITH ITS ATTACHMENTS UNDER THE TEXT */
.ps-thread { list-style: none; margin: 0; padding: 0; }
.ps-comment { display: flex; gap: 0.85rem; padding: 1rem 0; border-bottom: 1px solid #f1f5f9; }
.ps-comment:first-child { padding-top: 0; }
.ps-comment:last-child { border-bottom: 0; padding-bottom: 0; }
.ps-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #2a2f45; color: #ee6920; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.74rem; }
.ps-comment-main { flex: 1; min-width: 0; }
.ps-comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.ps-comment-name { font-weight: 700; font-size: 0.86rem; color: #1A233A; }
.ps-comment-time { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.72rem; color: #94a3b8; }
.ps-problem-text { font-size: 0.88rem; line-height: 1.6; white-space: pre-line; word-break: break-word; color: #334155; margin: 0; }
.ps-rca { padding: 1rem 0; border-bottom: 1px solid #f1f5f9; }
.ps-rca:first-child { padding-top: 0; }
.ps-rca:last-child { border-bottom: 0; padding-bottom: 0; }
.ps-rca-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; font-size: 0.86rem; color: #1A233A; font-weight: 700; }
.ps-comment-body { font-size: 0.87rem; line-height: 1.55; white-space: pre-line; word-break: break-word; color: #334155; margin-top: 0.25rem; }
.ps-files { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ps-file { display: inline-flex; align-items: baseline; gap: 0.45rem; max-width: 100%; padding: 0.4rem 0.7rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #fafbff; text-decoration: none; font-size: 0.78rem; font-weight: 600; color: #2a2f45; }
.ps-file:hover { border-color: #2a2f45; background: #fff; }
.ps-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-file-meta { flex-shrink: 0; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.68rem; font-weight: 500; color: #94a3b8; text-transform: uppercase; }

/* ACTIVITY TIMELINE */
.ps-timeline { list-style: none; margin: 0; padding: 0; }
.ps-timeline li { position: relative; display: flex; gap: 0.9rem; padding-bottom: 1rem; }
.ps-timeline li:last-child { padding-bottom: 0; }
.ps-timeline li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: #e2e8f0; }
.ps-timeline li:last-child::before { display: none; }
.ps-timeline-dot { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: #fff; border: 3px solid #2a2f45; flex-shrink: 0; }
.ps-timeline li:first-child .ps-timeline-dot { border-color: #ee6920; box-shadow: 0 0 0 4px rgba(238, 105, 32, 0.22); }
.ps-timeline-text { flex: 1; min-width: 0; }
.ps-timeline-label { font-weight: 700; font-size: 0.85rem; color: #1A233A; }
.ps-timeline-time { white-space: nowrap; }

.ps-empty { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.9rem 1rem; border-radius: 10px; background: #fafbff; border: 1px dashed #e2e8f0; color: #64748b; font-size: 0.85rem; }
.ps-empty .material-symbols-outlined { color: #94a3b8; font-size: 1.2rem; }

.ps-footer { text-align: center; font-size: 0.75rem; color: #64748b; line-height: 1.7; }
.ps-footer strong { color: #2a2f45; }

/* NOTE: REPLACES THE INLINE animation-delay STYLES OF THE BLADE VIEW, WHICH THE CONTENT SECURITY POLICY DOES NOT ALLOW */
.ps-delay-0 { animation-delay: 0.02s; }
.ps-delay-1 { animation-delay: 0.04s; }
.ps-delay-2 { animation-delay: 0.06s; }
.ps-delay-3 { animation-delay: 0.08s; }
.ps-delay-4 { animation-delay: 0.16s; }

@keyframes ps-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ps-card, .ps-status { animation: none; } }

@media (max-width: 760px) {
    .ps-header { padding-bottom: 5.5rem; }
    .ps-topbar { margin-bottom: 1.5rem; }
    .ps-status-body { padding: 1.25rem 1.25rem 1.35rem; }
    .ps-fact { padding: 0.8rem 1.25rem; border-right: 0; border-bottom: 1px solid #eef0f4; }
    .ps-track li { font-size: 0.7rem; }
    .ps-sla-grid { grid-template-columns: 1fr; }
}

/* TICKET SERVICE ONLY: SEARCH PAGE */
.sv-lead { font-size: 0.92rem; color: rgba(255, 255, 255, 0.75); margin: 0; max-width: 56ch; line-height: 1.55; }
.sv-search { background: #fff; border: 1px solid #e8eaf0; border-radius: 16px; box-shadow: 0 8px 20px rgba(42, 47, 69, 0.1); padding: 1.5rem 1.75rem; animation: ps-rise 0.45s ease both; }
.sv-label { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.85rem; color: #2a2f45; margin-bottom: 0.5rem; }
.sv-field { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sv-input { flex: 1 1 280px; min-width: 0; padding: 0.75rem 0.95rem; border: 1.5px solid #e2e8f0; border-radius: 10px; font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.95rem; letter-spacing: 0.02em; color: #1A233A; text-transform: uppercase; background: #fafbff; outline: none; }
.sv-input::placeholder { color: #a0a8b8; text-transform: none; }
.sv-input:focus { border-color: #ee6920; background: #fff; box-shadow: 0 0 0 4px rgba(238, 105, 32, 0.15); }
.sv-input[aria-invalid="true"] { border-color: #ef4444; }
.sv-submit { padding: 0.75rem 1.4rem; font-size: 0.9rem; }
.sv-submit:disabled { opacity: 0.6; cursor: progress; }
.sv-hint { font-size: 0.78rem; color: #64748b; margin: 0.55rem 0 0; }
.sv-error { display: flex; align-items: center; gap: 0.45rem; margin: 0.75rem 0 0; padding: 0.65rem 0.85rem; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 0.84rem; font-weight: 600; }
.sv-error .material-symbols-outlined { font-size: 1.1rem; }

/* TICKET SERVICE ONLY: LOADING AND ERROR STATES OF THE TICKET PAGE */
.sv-state { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; padding: 2.25rem 1.5rem; }
.sv-state .material-symbols-outlined { font-size: 2.4rem; color: #94a3b8; }
.sv-state h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.15rem; color: #1A233A; margin: 0; }
.sv-state p { font-size: 0.88rem; color: #64748b; margin: 0; max-width: 46ch; line-height: 1.5; }
.sv-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #e2e8f0; border-top-color: #ee6920; animation: sv-spin 0.8s linear infinite; }
@keyframes sv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sv-search { animation: none; } .sv-spinner { animation-duration: 2s; } }

/* NOTE: ELEMENTS WITH A display RULE (E.G. .ps-validity) WOULD OTHERWISE IGNORE THE hidden ATTRIBUTE */
[hidden] { display: none !important; }
