/* ─── SIDDHA MEDICINE ASSISTANT CHATBOT STYLES ──────────────────────────────── */
:root {
    --cb-primary: #17B978;
    --cb-secondary: #FFD700;
    --cb-bg-dark: rgba(30, 43, 23, 0.95);
    --cb-bg-light: rgba(255, 255, 255, 0.95);
    --cb-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

/* Floating Chatbot Bubble Trigger */
.chatbot-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #17B978 0%, #2d6a4f 100%);
    box-shadow: 0 8px 30px rgba(23, 185, 120, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-bubble i {
    color: white;
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.chatbot-bubble:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(23, 185, 120, 0.6);
}

.chatbot-bubble:hover i {
    transform: rotate(10deg);
}

/* Pulse Animation for Bubble */
.chatbot-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(23, 185, 120, 0.6);
    animation: cb-pulse 2s infinite linear;
    pointer-events: none;
}

@keyframes cb-pulse {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* Chatbot Panel Window */
.chatbot-panel {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: min(380px, 90vw);
    height: min(520px, 70vh);
    max-height: 70vh;
    border-radius: 24px;
    background: var(--cb-bg-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--cb-shadow);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.chatbot-panel.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* Chat Header */
.chatbot-header {
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(23, 185, 120, 0.25) 0%, rgba(45, 106, 79, 0.2) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cb-doctor-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cb-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.cb-avatar-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cb-primary);
}

.cb-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #25D366;
    border: 2px solid var(--cb-bg-dark);
}

.cb-doctor-details h4 {
    margin: 0;
    color: white !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.cb-doctor-details span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* Chat Messages Content Area */
.chatbot-messages {
    flex: 1 1 0%;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Messages */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Chat Message Bubbles */
.cb-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    animation: cb-slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes cb-slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cb-message.bot {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.95);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.cb-message.user {
    background: linear-gradient(135deg, var(--cb-primary) 0%, #2d6a4f 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(23, 185, 120, 0.15);
}

/* Quick Reply Options Section */
.cb-quick-replies {
    padding: 8px 15px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cb-quick-replies::-webkit-scrollbar {
    height: 3px;
}

.cb-quick-replies::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.cb-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cb-chip:hover {
    background: rgba(23, 185, 120, 0.2);
    border-color: var(--cb-primary);
    color: white;
    transform: translateY(-1px);
}

/* Chat Input Bar */
.chatbot-input-area {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 18px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chatbot-input-area input:focus {
    border-color: var(--cb-primary);
    background: rgba(255, 255, 255, 0.08);
}

.cb-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cb-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(23, 185, 120, 0.3);
}

.cb-send-btn:hover {
    background: #1cb577;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(23, 185, 120, 0.5);
}

/* Dynamic mini Product Cards inside Chat */
.cb-product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 10px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cb-product-img {
    height: 110px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cb-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-product-img i {
    font-size: 3rem;
    color: var(--cb-primary);
}

.cb-product-info {
    padding: 12px;
}

.cb-product-info h5 {
    margin: 0 0 4px 0;
    font-size: 0.88rem;
    color: white !important;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cb-product-info .cb-category {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cb-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.cb-product-footer .cb-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cb-primary);
}

.cb-product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px 12px 12px;
}

.cb-action-btn {
    padding: 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cb-action-btn.cart {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cb-action-btn.cart:hover {
    background: var(--cb-primary);
    color: white;
    border-color: var(--cb-primary);
}

.cb-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.cb-action-btn.whatsapp:hover {
    background: #1ebe5d;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

/* Typing Indicator Animation */
.cb-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 8px;
}

.cb-typing-indicator span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: cb-type 1.3s infinite ease-in-out;
}

.cb-typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.cb-typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes cb-type {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
        background: var(--cb-primary);
    }
}

/* Product Link and Doctor Advisory Styles */
.cb-product-link-wrapper {
    display: block;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
}

.cb-product-title-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.cb-product-title-link:hover h5 {
    color: var(--cb-primary) !important;
}

.cb-doctor-advisory {
    border: 1px dashed rgba(23, 185, 120, 0.4);
    background: rgba(23, 185, 120, 0.08) !important;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
}

.cb-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25D366;
    color: white !important;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    margin: 6px 0;
    transition: all 0.2s ease;
}

.cb-doc-link:hover {
    background: #1ebe5d;
    transform: translateY(-1px);
}

.cb-phone-link {
    color: var(--cb-primary) !important;
    text-decoration: underline;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.cb-phone-link:hover {
    opacity: 0.8;
}

/* Desktop vs Mobile Responsiveness */
@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100% - 30px);
        height: min(480px, 75vh);
        max-height: 75vh;
        right: 15px;
        bottom: 85px;
    }
    .chatbot-bubble {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}
