/*body {*/
/*    background-color: lightgray;*/
/*}*/

/*.label-as-badge {*/
/*    border-radius: 1em;*/
/*}*/

@media print {
    a[href]:after {
        content: none !important;
    }
}


.dropdown-menu-animated {
    animation: dropdownAnimation 0.2s ease-out;
}
@keyframes dropdownAnimation {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticket-description {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--read-more-line-clamp, 4);
}

.note-line {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--read-more-line-clamp, 6);
}

.feedback-line {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--read-more-line-clamp, 3);
}


.turboload[aria-busy="true"] {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 20px;
    opacity: 0.5;
}

.photo-link:hover img {
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
}

.modal-header {
    border-bottom: 2px solid #eee;
    background-color: var(--bs-light);

}

.form-label {
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.container {
    max-width: 1420px; /* Set a higher max width for all breakpoints */
}

.opacity-100-hover:hover {
    opacity: 1 !important;
}


/* ══════════════════════════════════════════════════════════════════
   Helpdesk Chat Widget
   ══════════════════════════════════════════════════════════════════ */

/* ── Toggle button ─────────────────────────────────────────────── */
.hc-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1055;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hc-toggle:hover {
    background: #0b5ed7;
    transform: scale(1.08);
}

.hc-toggle--open {
    background: #495057;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: none !important;
}

.hc-toggle--offline {
    background: #6c757d !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
}

.hc-toggle--offline:hover {
    background: #5c636a !important;
    transform: scale(1.05);
}

.hc-toggle .bi {
    font-size: 1.5rem;
    line-height: 1;
}

.hc-icon-open  { display: block; }
.hc-icon-close { display: none; }
.hc-toggle--open .hc-icon-open  { display: none; }
.hc-toggle--open .hc-icon-close { display: block; }

/* Pulse attention animation when closed */
@keyframes hc-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(13, 110, 253, 0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0   rgba(13, 110, 253, 0); }
}

.hc-toggle:not(.hc-toggle--open) {
    animation: hc-pulse 2.2s infinite;
}

/* Unread badge */
.hc-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ── Panel ─────────────────────────────────────────────────────── */
.hc-panel {
    position: fixed;
    bottom: 5.25rem;
    right: 1.5rem;
    z-index: 1050;
    width: 500px;
    max-width: calc(100vw - 2rem);
    height: min(76vh, 760px);
    max-height: calc(100vh - 6.5rem);
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Hidden state */
    opacity: 0;
    transform: scale(0.88) translateY(16px);
    pointer-events: none;
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.hc-panel--open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* ── Header ────────────────────────────────────────────────────── */
.hc-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.hc-header__avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hc-header__info {
    flex: 1;
    min-width: 0;
}

.hc-header__title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.hc-header__subtitle {
    font-size: 0.72rem;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hc-online-dot {
    width: 7px;
    height: 7px;
    background: #86efac;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.hc-offline-dot {
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.hc-header__btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.3rem 0.5rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.hc-header__btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

/* ── Messages ──────────────────────────────────────────────────── */
.hc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.hc-messages::-webkit-scrollbar       { width: 4px; }
.hc-messages::-webkit-scrollbar-track { background: transparent; }
.hc-messages::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }

.hc-msg {
    display: flex;
    flex-direction: column;
    max-width: 92%;
    animation: hc-fadein 0.18s ease;
}

@keyframes hc-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hc-msg--user      { align-self: flex-end;  align-items: flex-end; }
.hc-msg--assistant,
.hc-msg--error     { align-self: flex-start; align-items: flex-start; }

/* Bubbles */
.hc-bubble {
    padding: 0.6rem 0.9rem;
    border-radius: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    word-break: break-word;
}

.hc-msg--user .hc-bubble {
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 0.3rem;
}

.hc-msg--assistant .hc-bubble {
    background: #fff;
    color: #212529;
    border-bottom-left-radius: 0.3rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.hc-msg--error .hc-bubble {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffc107;
    border-bottom-left-radius: 0.3rem;
}

/* Markdown content inside assistant bubble */
.hc-bubble p              { margin-bottom: 0.45rem; }
.hc-bubble p:last-child   { margin-bottom: 0; }
.hc-bubble ul,
.hc-bubble ol             { padding-left: 1.3rem; margin-bottom: 0.45rem; }
.hc-bubble li             { margin-bottom: 0.15rem; }
.hc-bubble strong         { font-weight: 600; }
.hc-bubble code {
    background: #f1f3f5;
    color: #d63384;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.82em;
    font-family: ui-monospace, 'Cascadia Code', monospace;
}
.hc-bubble pre {
    background: #f1f3f5;
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    overflow-x: auto;
    font-size: 0.8em;
    margin-bottom: 0.45rem;
}
.hc-bubble pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.hc-bubble h1, .hc-bubble h2, .hc-bubble h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

/* Sources */
.hc-sources {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.hc-sources__label {
    font-weight: 600;
    color: #495057;
}

.hc-source-chip {
    background: #e9ecef;
    color: #0d6efd;
    border-radius: 100px;
    padding: 0.1rem 0.6rem;
    text-decoration: none;
    font-size: 0.7rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.hc-source-chip:hover {
    background: #0d6efd;
    color: #fff;
}

/* Feedback thumbs */
.hc-feedback {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.hc-feedback-btn {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 0.1rem 0.2rem;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, transform 0.1s;
    border-radius: 0.3rem;
}

.hc-feedback-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.15);
}

.hc-feedback-btn:disabled {
    cursor: default;
}

.hc-feedback-btn--active {
    opacity: 1 !important;
}

/* Timestamps */
.hc-timestamp {
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: #adb5bd;
    letter-spacing: 0.01em;
}

/* Ticket footer */
.hc-footer {
    padding: 0.5rem 0.75rem 0.6rem;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
    transition: background 0.3s, border-top-color 0.3s;
}

/* Bot-recommended escalation state */
.hc-footer--suggested {
    background: #eff6ff;
    border-top-color: #93c5fd;
}

.hc-footer--suggested::before {
    content: "The assistant recommends opening a ticket";
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1d4ed8;
    text-align: center;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.hc-open-ticket-btn {
    width: 100%;
    background: #fff3cd;
    color: #664d03;
    border: 1.5px solid #ffc107;
    border-radius: 0.6rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.hc-open-ticket-btn:hover:not(:disabled) {
    background: #ffe69c;
    border-color: #ffca2c;
}

/* Suggested state — button goes primary blue with pulse */
.hc-footer--suggested .hc-open-ticket-btn {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
    animation: hc-ticket-pulse 2s ease-in-out infinite;
}

.hc-footer--suggested .hc-open-ticket-btn:hover:not(:disabled) {
    background: #1e40af;
    border-color: #1e40af;
    animation: none;
}

@keyframes hc-ticket-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(29, 78, 216, 0.45); }
    50%       { box-shadow: 0 0 0 8px rgba(29, 78, 216, 0); }
}

.hc-open-ticket-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    animation: none;
}

/* ── Typing indicator ──────────────────────────────────────────── */
.hc-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0.55rem 0.8rem !important;
    min-width: 56px;
}

.hc-typing span {
    width: 7px;
    height: 7px;
    background: #adb5bd;
    border-radius: 50%;
    display: inline-block;
    animation: hc-bounce 1.1s infinite ease-in-out;
}

.hc-typing span:nth-child(2) { animation-delay: 0.16s; }
.hc-typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes hc-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.5; }
    30%            { transform: translateY(-5px); opacity: 1;   }
}

/* ── Input area ────────────────────────────────────────────────── */
.hc-input-area {
    padding: 0.75rem;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}

.hc-input-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.hc-input {
    flex: 1;
    border: 1.5px solid #dee2e6;
    border-radius: 1.25rem;
    padding: 0.5rem 0.95rem;
    font-size: 0.875rem;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    line-height: 1.45;
    font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
    display: block;
    width: 100%;
}

.hc-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.hc-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.18s, transform 0.12s;
    font-size: 0.9rem;
}

.hc-send-btn:hover:not(:disabled) {
    background: #0b5ed7;
    transform: scale(1.07);
}

.hc-send-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.hc-disclaimer {
    text-align: center;
    font-size: 0.65rem;
    color: #ced4da;
    margin-top: 0.4rem;
    letter-spacing: 0.01em;
}

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .hc-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 82vh;
        max-height: 82vh;
        border-radius: 1.25rem 1.25rem 0 0;
        transform-origin: bottom center;
    }

    .hc-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}