/*=========================================================
    SERI HELP DESK CHATBOT
=========================================================*/

.chat-page {
    min-height: 100vh;
    background: var(--body-bg);
    display: flex;
    flex-direction: column;
}

.chat-page__header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
    color: #fff;
    padding: 12px 0;
    box-shadow: var(--shadow-md);
}

.chat-page__header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.chat-page__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-page__brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.chat-page__brand h1 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0;
    font-weight: 700;
}

.chat-page__brand p {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.85;
}

.chat-page__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s;
    text-decoration: none;
}

.chat-action-btn:hover {
    background: #fff;
    color: var(--primary);
}

.chat-action-btn--danger:hover {
    background: #fff;
    color: var(--danger);
}

.chat-lang-switcher {
    display: flex;
    gap: 6px;
}

.chat-lang-btn {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: 0.25s;
}

.chat-lang-btn:hover,
.chat-lang-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Main chat container */

.chat-app {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    min-height: calc(100vh - 72px);
}

.chat-app--fullscreen,
.chat-app--expanded {
    max-width: 100%;
    padding: 20px 24px;
    background: var(--body-bg);
}

.chat-page .chat-app--expanded {
    position: fixed;
    inset: 0;
    z-index: 1050;
    min-height: 100vh;
    margin: 0;
    width: 100%;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    min-height: 0;
}

.chat-panel__header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--section-bg);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-panel__header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-panel__header-text h2 {
    font-size: 1rem;
    margin: 0;
    color: var(--heading);
    font-weight: 700;
}

.chat-panel__header-text p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-light);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 420px;
    max-height: calc(100vh - 260px);
    scroll-behavior: smooth;
}

.chat-app--fullscreen .chat-messages,
.chat-app--expanded .chat-messages {
    max-height: none;
}

/* Message bubbles */

.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 92%;
    animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg--bot {
    align-self: flex-start;
}

.chat-msg__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.chat-msg--bot .chat-msg__avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

.chat-msg--user .chat-msg__avatar {
    background: var(--border);
    color: var(--text);
}

.chat-msg__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg__bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    word-break: break-word;
}

.chat-msg--bot .chat-msg__bubble {
    background: var(--section-bg);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-top-left-radius: 4px;
}

.chat-msg--user .chat-msg__bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-top-right-radius: 4px;
}

.chat-msg__bubble--typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
}

.chat-msg__bubble--typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: chatDot 1.2s infinite ease-in-out;
}

.chat-msg__bubble--typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg__bubble--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Question chips */

.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    line-height: 1.4;
}

.chat-chip:hover {
    background: var(--primary);
    color: #fff;
}

.chat-chip--lang {
    border-color: var(--accent);
    color: var(--primary-dark);
    background: var(--accent-light);
}

.chat-chip--lang:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.chat-chip--other {
    border-style: dashed;
    background: var(--section-bg);
}

.chat-chip--other:hover {
    background: var(--primary);
    border-style: solid;
    color: #fff;
}

/* Input area */

.chat-input-area {
    border-top: 1px solid var(--border-light);
    padding: 14px 16px;
    background: var(--section-bg);
    display: flex;
    gap: 10px;
    transition: box-shadow 0.3s;
}

.chat-input-area--hidden {
    display: none;
}

.chat-input-area--disabled {
    opacity: 0.6;
    pointer-events: none;
}

.chat-input-area--highlight {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 0.92rem;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Floating widget shell (site-wide) */

.chat-widget {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s, visibility 0.25s;
}

.chat-widget--open {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}
/* .text-white{
    color: #fff;
} */
 #chatSubtitle, #chatTitle{
    color: #fff;
 }
.chat-widget__panel {
    position: fixed;
    bottom: 40px;
    right: 24px;
    width: 380px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease, width 0.3s ease, height 0.3s ease, bottom 0.3s ease, right 0.3s ease, border-radius 0.3s ease;
}

.chat-widget--open .chat-widget__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.chat-widget--expanded .chat-widget__panel {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
}

.chat-widget__header {
    flex-shrink: 0;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-widget__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-widget__header-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-widget__header-text {
    min-width: 0;
}

.chat-widget__header-text h2 {
    font-size: 0.9rem;
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-widget__header-text p {
    margin: 0;
    font-size: 0.68rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-widget__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-widget__actions .chat-lang-switcher {
    display: none;
}

.chat-widget__actions .chat-action-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
}

.chat-widget__actions .chat-action-btn .d-none {
    display: none !important;
}

.chat-widget__close-btn {
    padding: 5px 8px !important;
}

.chat-widget .chat-app {
    flex: 1;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-widget .chat-panel {
    flex: 1;
    border-radius: 0;
    box-shadow: none;
    border: none;
    min-height: 0;
}

.chat-widget .chat-panel__header {
    display: none;
}

.chat-widget .chat-messages {
    min-height: 0;
    max-height: none;
    flex: 1;
}

.chat-widget--expanded .chat-widget__actions .chat-lang-switcher {
    display: flex;
}

.chat-launcher {
    position: fixed;
    bottom: 40px;
    right: 24px;
    z-index: 1060;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(196, 88, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s;
    text-decoration: none;
}

.chat-launcher:hover {
    transform: scale(1.08);
    color: #fff;
}

.chat-launcher__label {
    position: absolute;
    right: 68px;
    background: var(--heading);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.chat-launcher:hover .chat-launcher__label {
    opacity: 1;
}

.chat-launcher--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

@media (max-width: 768px) {
    .chat-page__header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-page__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .chat-messages {
        min-height: 320px;
        max-height: calc(100vh - 300px);
    }

    .chat-msg {
        max-width: 98%;
    }

    .chat-launcher {
        bottom: 80px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .chat-launcher__label {
        display: none;
    }

    .chat-widget__panel {
        bottom: 80px;
        right: 12px;
        left: 12px;
        width: auto;
        height: 85vh;
    }

    .chat-widget--expanded .chat-widget__panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .chat-widget__actions .chat-lang-switcher {
        display: none;
    }

    .chat-widget--expanded .chat-widget__actions .chat-lang-switcher {
        display: flex;
    }
}
