/* ==========================================================================
   Om Sai Pathibhara Hospital – Virtual AI Chatbot Styles
   ========================================================================== */

/* --- Floating Action Button (FAB) --- */
.hosp-chatbot-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b8ac 0%, #00968c 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 184, 172, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.hosp-chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 184, 172, 0.6);
}

.hosp-chatbot-fab:active {
    transform: scale(0.95);
}

/* Pulsating Glow Animation */
.hosp-chatbot-fab::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #00b8ac;
    opacity: 0;
    box-sizing: border-box;
    animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* --- Chat Container/Window --- */
.hosp-chatbot-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 390px;
    height: 580px;
    max-height: calc(100vh - 120px);
    max-width: calc(100vw - 50px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hosp-chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* --- Chat Header --- */
.hosp-chatbot-header {
    background: linear-gradient(135deg, #00b8ac 0%, #00968c 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hosp-chatbot-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hosp-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.hosp-chatbot-title-wrap h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.2px;
}

.hosp-chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    opacity: 0.9;
    margin-top: 2px;
}

.hosp-chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.hosp-chatbot-actions {
    display: flex;
    gap: 12px;
}

.hosp-chatbot-btn {
    background: none;
    border: none;
    color: #ffffff;
    opacity: 0.8;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: opacity 0.2s, transform 0.2s;
    outline: none;
}

.hosp-chatbot-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* --- Chat Messages Scroll Area --- */
.hosp-chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Scrollbar Customization */
.hosp-chatbot-body::-webkit-scrollbar {
    width: 5px;
}
.hosp-chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}
.hosp-chatbot-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* --- Message Bubbles --- */
.hosp-chatbot-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-wrap: break-word;
    font-family: 'Inter', sans-serif;
    animation: chatbot-fade-in 0.25s ease-out forwards;
}

@keyframes chatbot-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hosp-chatbot-msg.assistant {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border-top-left-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.hosp-chatbot-msg.user {
    background: #00b8ac;
    color: #ffffff;
    align-self: flex-end;
    border-top-right-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 184, 172, 0.2);
}

/* --- Typing Indicator --- */
.hosp-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    border-top-left-radius: 2px;
    align-self: flex-start;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.hosp-chatbot-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s infinite ease-in-out both;
}

.hosp-chatbot-dot:nth-child(1) { animation-delay: -0.32s; }
.hosp-chatbot-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* --- Chat Input Footer --- */
.hosp-chatbot-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hosp-chatbot-input-wrap {
    flex: 1;
    position: relative;
}

.hosp-chatbot-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}

.hosp-chatbot-input:focus {
    border-color: #00b8ac;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 184, 172, 0.1);
}

.hosp-chatbot-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #00b8ac;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex-shrink: 0;
    outline: none;
}

.hosp-chatbot-send-btn:hover {
    background: #00968c;
    transform: scale(1.05);
}

.hosp-chatbot-send-btn:active {
    transform: scale(0.95);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .hosp-chatbot-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        border: none;
    }
    
    .hosp-chatbot-window.open {
        transform: translateY(0) scale(1);
    }
    
    .hosp-chatbot-header {
        padding: 18px 16px;
    }
    
    .hosp-chatbot-fab {
        bottom: 20px;
        right: 20px;
    }
}

/* Shift back-to-top button higher so it doesn't overlap with the chatbot FAB */
.back-to-top {
    bottom: 95px !important;
    z-index: 99998 !important;
    right: 30px !important; /* Keep center aligned with chatbot */
}

/* Mobile responsive stack adjustments for floating buttons */
@media (max-width: 768px) {
    .hosp-chatbot-fab {
        bottom: 15px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }
    
    .back-to-top {
        bottom: 75px !important;
        right: 18px !important; /* Center-aligns with 50px chatbot FAB at right: 15px */
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
    }
}

/* Rich text formatting styles in chat bubbles */
.hosp-chatbot-msg ul, .hosp-chatbot-msg ol {
    margin: 8px 0;
    padding-left: 20px;
}
.hosp-chatbot-msg li {
    margin-bottom: 4px;
}
.hosp-chatbot-msg strong {
    font-weight: 700;
    color: inherit;
}
.hosp-chatbot-msg code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}
.hosp-chatbot-msg.user code {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Pre-chat Registration Form --- */
.hosp-chatbot-form-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px !important;
    overflow-y: auto;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
}
.hosp-chatbot-form-welcome {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}
.hosp-chatbot-form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}
.hosp-chatbot-form-group label {
    font-weight: 600;
    font-size: 0.78rem;
    color: #1e293b;
    margin-bottom: 6px;
    text-align: left;
}
.hosp-chatbot-form-group input,
.hosp-chatbot-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    outline: none;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.hosp-chatbot-form-group input:focus,
.hosp-chatbot-form-group select:focus {
    border-color: #00b8ac;
    box-shadow: 0 0 0 3px rgba(0, 184, 172, 0.1);
}
.hosp-chatbot-form-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(135deg, #00b8ac 0%, #00968c 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
}
.hosp-chatbot-form-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 184, 172, 0.3);
    transform: translateY(-1px);
}
.hosp-chatbot-form-btn:active {
    transform: translateY(0);
}

/* --- Pre-chat Registration Form Welcome Screen Enhancements --- */
.hosp-chatbot-welcome-header {
    text-align: center;
    margin-bottom: 15px;
}

.hosp-chatbot-welcome-icon {
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, rgba(0, 184, 172, 0.12) 0%, rgba(0, 150, 140, 0.12) 100%);
    color: #00b8ac;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    margin: 5px auto 12px auto;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 184, 172, 0.15);
    animation: chatbot-welcome-float 3s ease-in-out infinite;
}

.hosp-chatbot-welcome-icon::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2.5px dashed rgba(0, 184, 172, 0.25);
    border-radius: 50%;
    animation: chatbot-rotate 20s linear infinite;
}

.hosp-chatbot-welcome-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #4ade80;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
}

.hosp-chatbot-welcome-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1e293b;
    margin-bottom: 4px;
    text-align: center;
    background: linear-gradient(135deg, #00b8ac 0%, #007c74 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hosp-chatbot-welcome-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin: 0;
    line-height: 1.45;
}

.hosp-chatbot-welcome-subtitle strong {
    color: #1e293b;
    font-weight: 600;
}

.hosp-chatbot-input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.hosp-chatbot-input-field-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 0.95rem;
    transition: color 0.25s ease;
    pointer-events: none;
}

.hosp-chatbot-input-icon-wrapper input,
.hosp-chatbot-input-icon-wrapper select {
    padding-left: 38px !important;
}

.hosp-chatbot-input-icon-wrapper input:focus + .hosp-chatbot-input-field-icon,
.hosp-chatbot-input-icon-wrapper select:focus + .hosp-chatbot-input-field-icon {
    color: #00b8ac;
}

/* Animations */
@keyframes chatbot-welcome-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes chatbot-rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* --- Interactive Quick-Reply Chips --- */
.hosp-chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 5px;
    animation: chatbot-fade-in 0.3s ease-out forwards;
    align-self: flex-start;
    max-width: 95%;
    padding-left: 2px;
}

.hosp-chatbot-chip {
    background: #ffffff;
    border: 1.5px solid #00b8ac;
    color: #00b8ac;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 184, 172, 0.05);
    outline: none;
}

.hosp-chatbot-chip i {
    font-size: 0.82rem;
}

.hosp-chatbot-chip:hover {
    background: #00b8ac;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 184, 172, 0.25);
}

.hosp-chatbot-chip:active {
    transform: translateY(0) scale(0.95);
}



