/* ===== Ticket System - Tailwind Companion Styles ===== */

/* Selection */
::selection {
    background-color: rgba(29, 78, 216, 0.15);
    color: inherit;
}

/* ===== Card Enhancement (stronger contrast on bg-slate-200) ===== */
.bg-white.rounded-2xl {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

/* ===== Badges (used by badge_class() PHP helper) ===== */
.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    white-space: nowrap;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #334155;
    border: 1px solid transparent;
}

.badge.amber { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.blue { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.badge.green { background: #dcfce7; color: #166534; border-color: #86efac; }
.badge.rose { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge.gray { background: #e5e7eb; color: #475569; border-color: #cbd5e1; }

/* ===== Timeline ===== */
.timeline { display: grid; gap: 1rem; }

.timeline-item {
    padding: 1rem 1.25rem;
    border-left: 4px solid #cbd5e1;
    border-radius: 0 1rem 1rem 0;
    background: #f8fafc;
    overflow: hidden;
}

.timeline-item.customer { border-left-color: #0ea5e9; }
.timeline-item.attendant,
.timeline-item.admin { border-left-color: #22c55e; }
.timeline-item.system { border-left-color: #94a3b8; }

.timeline-item header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.timeline-message {
    line-height: 1.7;
    max-width: 62ch;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ===== Attachments ===== */
.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.attachments-images-centered {
    justify-content: center;
}

.attachment-card { display: grid; gap: 0.45rem; width: 160px; }

.attachment-thumb {
    display: block;
    width: 160px;
    height: 120px;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #dbeafe;
    background: #eff6ff;
}

.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-link { font-size: 0.85rem; line-height: 1.4; color: #1d4ed8; }
.attachment-link {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.attachments a:not(.attachment-thumb):not(.attachment-link) {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.875rem;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .timeline-message {
        max-width: 100%;
    }
}

/* ===== Image Viewer ===== */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.86);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.image-viewer.is-open {
    display: flex;
}

.image-viewer-stage {
    position: relative;
    width: min(1200px, 96vw);
    height: min(82vh, 780px);
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 1rem;
    overflow: hidden;
}

.image-viewer-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.08s linear;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.image-viewer-toolbar {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.45rem;
    z-index: 5;
}

.image-viewer-toolbar button {
    border: 0;
    background: rgba(2, 6, 23, 0.86);
    color: #f8fafc;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.image-viewer-caption {
    position: absolute;
    left: 0.85rem;
    bottom: 0.75rem;
    z-index: 5;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.7);
    font-size: 0.82rem;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
}

/* ===== Attachment Previews ===== */
.attachment-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.attachment-preview-item { width: 120px; display: grid; gap: 0.4rem; }

.attachment-preview-item small {
    display: block;
    max-width: 120px;
    color: #475569;
    font-size: 0.74rem;
    line-height: 1.2;
    word-break: break-word;
    white-space: normal;
}

.attachment-preview-item img,
.attachment-preview-file {
    width: 120px;
    height: 90px;
    border-radius: 0.875rem;
    border: 1px solid #dbeafe;
    object-fit: cover;
    background: #eff6ff;
}

.youtube-embed-wrap {
    max-width: 100%;
}

.youtube-embed-wrap iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid #dbeafe;
    border-radius: 0.85rem;
    background: #0f172a;
}

.attachment-preview-file {
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #1d4ed8;
}

/* ===== Captcha ===== */
.captcha-wrap {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-image {
    border-radius: 1rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

/* ===== Snippet results ===== */
.snippet-body {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.875rem;
    line-height: 1.7;
}

mark {
    background: #fde68a;
    padding: 0 0.15rem;
    border-radius: 2px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out both; }

/* ===== Print ===== */
@media print {
    nav, footer, .no-print { display: none !important; }
    body { background: white !important; }
}
