/* Explain: Styles for the floating consultation chatbot widget with a callout. */
/* Floating consultation chatbot widget for PALA INR ART. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-widget {
    position: fixed;
    right: clamp(1rem, 4vw, 1.75rem);
    bottom: clamp(1rem, 4vw, 1.75rem);
    z-index: 96;
    font-family: var(--font-body);
}

.chat-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    color: #14110A;
    font-size: 1.35rem;
    box-shadow: 0 16px 36px rgba(201, 162, 39, 0.35);
    cursor: pointer;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.chat-toggle:hover {
    box-shadow: 0 20px 44px rgba(201, 162, 39, 0.5);
    transform: translateY(-3px) scale(1.03);
}

.chat-toggle__icon-close {
    display: none;
}

.chat-widget.is-open .chat-toggle__icon-open {
    display: none;
}

.chat-widget.is-open .chat-toggle__icon-close {
    display: inline-block;
}

.chat-toggle__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #E08B7A;
    color: #1a0f0f;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 0 0 3px var(--background-color);
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 4.4rem;
    display: flex;
    flex-direction: column;
    width: min(92vw, 23rem);
    max-height: min(80vh, 34rem);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    background: linear-gradient(165deg, rgba(26, 26, 26, 0.98), rgba(10, 10, 10, 0.98));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
    animation: chatIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-panel[hidden] {
    display: none;
}

@keyframes chatIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.chat-panel__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(16, 16, 16, 0.7);
}

.chat-panel__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.12);
    color: var(--gold-light);
}

.chat-panel__intro {
    flex: 1;
    min-width: 0;
}

.chat-panel__title {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-panel__status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.chat-panel__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #8FBF7F;
    box-shadow: 0 0 0 3px rgba(143, 191, 127, 0.25);
}

.chat-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 250ms ease, border-color 250ms ease;
}

.chat-panel__close:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-msg {
    display: flex;
    max-width: 100%;
}

.chat-msg--bot {
    justify-content: flex-start;
}

.chat-msg--user {
    justify-content: flex-end;
}

.chat-msg__bubble {
    max-width: 88%;
    padding: 0.65rem 0.9rem;
    border-radius: 1.1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
}

.chat-msg--bot .chat-msg__bubble {
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.chat-msg--user .chat-msg__bubble {
    border-bottom-right-radius: 0.3rem;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    color: #14110A;
    font-weight: 500;
}

.chat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold-light);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 250ms ease, color 250ms ease;
}

.chat-link:hover {
    background: var(--gold);
    color: #14110A;
}

.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 1rem 0.5rem;
}

.chat-quick__btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.08);
    color: var(--gold-light);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 250ms ease, border-color 250ms ease, color 250ms ease;
}

.chat-quick__btn:hover {
    border-color: var(--gold);
    background: rgba(201, 162, 39, 0.18);
    color: #FFFFFF;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border-color);
}

.chat-form__input {
    flex: 1;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--field-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color 250ms ease, box-shadow 250ms ease;
}

.chat-form__input::placeholder {
    color: var(--text-muted);
}

.chat-form__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.16);
}

.chat-form__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    color: #14110A;
    cursor: pointer;
    transition: opacity 250ms ease, transform 250ms ease;
}

.chat-form__send:hover {
    transform: scale(1.05);
}

.chat-form__send:disabled,
.chat-form__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Callout with an arrow pointing at the chat button. */
.chat-callout {
    position: absolute;
    right: 4.4rem;
    bottom: 0.7rem;
    z-index: 94;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    animation: chatCalloutIn 0.7s 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-callout[hidden] {
    display: none;
}

.chat-callout__bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: linear-gradient(165deg, rgba(26, 26, 26, 0.98), rgba(12, 12, 12, 0.98));
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
    transition: border-color 250ms ease, transform 250ms ease;
}

.chat-callout__bubble::after {
    position: absolute;
    top: 50%;
    right: -5px;
    width: 10px;
    height: 10px;
    border-top: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    background: rgba(14, 14, 14, 0.98);
    content: "";
    transform: translateY(-50%) rotate(45deg);
}

.chat-callout:hover .chat-callout__bubble,
.chat-callout:focus-visible .chat-callout__bubble {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.chat-callout__icon {
    color: var(--gold-light);
    font-size: 0.85rem;
}

.chat-callout__arrow {
    color: var(--gold-light);
    font-size: 0.9rem;
    animation: chatArrowNudge 1.5s ease-in-out infinite;
}

@keyframes chatArrowNudge {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

@keyframes chatCalloutIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 420px) {
    .chat-callout__bubble {
        font-size: 0.72rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-callout,
    .chat-callout__arrow {
        animation: none;
    }
}