﻿/* NaIA Patient chat, floating on the main patient portal.
   The z-index stays under the Bootstrap modals (1040-1050): the booking tunnel opens its
   instruction and questionnaire modals on top of the page, and they must never be hidden. */

.naia-patient-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px 10px 10px;
    border: 3px solid #fff;
    border-radius: 40px;
    /* Both ends keep white text above the 4.5:1 WCAG AA contrast (6.7:1 and 5.7:1). */
    background: linear-gradient(135deg, var(--naia-patient-primary, #5B3FD6), #7048E0);
    color: #fff;
    text-align: left;
    box-shadow: 0 6px 24px rgba(91, 63, 214, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    /* A few pulses when the page opens draw the eye, then it stays still so as not to distract. */
    animation: naia-patient-launcher-pulse 2s ease-out 1s 3;
}

.naia-patient-launcher:hover,
.naia-patient-launcher:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(91, 63, 214, 0.55);
}

.naia-patient-launcher-icon {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 9px;
    border-radius: 50%;
    background: #fff;
    fill: var(--naia-patient-primary, #5B3FD6);
}

.naia-patient-launcher-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.naia-patient-launcher-title {
    font-size: 16px;
    font-weight: 700;
}

.naia-patient-launcher-subtitle {
    font-size: 12px;
}

@keyframes naia-patient-launcher-pulse {
    0% {
        box-shadow: 0 6px 24px rgba(91, 63, 214, 0.45), 0 0 0 0 rgba(138, 92, 246, 0.6);
    }
    100% {
        box-shadow: 0 6px 24px rgba(91, 63, 214, 0.45), 0 0 0 18px rgba(138, 92, 246, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .naia-patient-launcher {
        animation: none;
        transition: none;
    }
}

.naia-patient-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 40px);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.naia-patient-panel[hidden],
.naia-patient-launcher[hidden] {
    display: none;
}

.naia-patient-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--naia-patient-primary, #5B3FD6);
    color: #fff;
}

.naia-patient-title {
    font-weight: 600;
}

.naia-patient-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.naia-patient-notice {
    margin: 0;
    padding: 8px 14px;
    background: #F4F2FC;
    color: #4A4760;
    font-size: 12px;
}

.naia-patient-messages {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
}

.naia-patient-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.naia-patient-message-patient {
    margin-left: 40px;
    background: #E8E4FA;
}

.naia-patient-message-naia {
    margin-right: 20px;
    background: #F5F5F7;
}

.naia-patient-message-error {
    background: #FDECEC;
    color: #9B1C1C;
}

.naia-patient-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    white-space: normal;
}

.naia-patient-slot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 10px;
    border: 1px solid var(--naia-patient-primary, #5B3FD6);
    border-radius: 8px;
    background: #fff;
    color: #1F1B33;
    text-align: left;
    cursor: pointer;
}

.naia-patient-slot:hover,
.naia-patient-slot:focus {
    background: #F4F2FC;
}

.naia-patient-slot-date {
    font-weight: 600;
}

.naia-patient-slot-date::first-letter {
    text-transform: uppercase;
}

.naia-patient-slot-place {
    color: #5B5870;
    font-size: 12px;
}

.naia-patient-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    white-space: normal;
}

.naia-patient-reply {
    padding: 5px 12px;
    border: 1px solid var(--naia-patient-primary, #5B3FD6);
    border-radius: 16px;
    background: #fff;
    color: var(--naia-patient-primary, #5B3FD6);
    font-size: 13px;
    cursor: pointer;
}

.naia-patient-reply:hover,
.naia-patient-reply:focus {
    background: #F4F2FC;
}

.naia-patient-input {
    display: flex;
    gap: 8px;
    padding: 10px 14px 6px;
    border-top: 1px solid #E6E4EE;
}

.naia-patient-textarea {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #CFCBDD;
    border-radius: 6px;
    resize: none;
    font-size: 14px;
}

.naia-patient-send {
    padding: 0 14px;
    border: none;
    border-radius: 6px;
    background: var(--naia-patient-primary, #5B3FD6);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.naia-patient-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.naia-patient-classic {
    margin: 0 14px 10px;
    padding: 4px 0;
    border: none;
    background: transparent;
    color: #5B5870;
    font-size: 12px;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 480px) {
    .naia-patient-panel {
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }
}
