@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ==========================================================
   LDS Pharma AI Chat Widget - Premium Glassmorphism UI
   ========================================================== */

:root {
    --primary-bg: linear-gradient(135deg, #28536b, #1a3b50);
    --primary-solid: #28536b;
    --accent-color: #f37021;
    --primary-light: rgba(40, 83, 107, 0.1);
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.1);
}

#lds-pharma-chat-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tooltip for Chat Bubble */
#lds-pharma-chat-bubble::after {
    content: "Chat with LDS Pharma AI";
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #0f172a;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#lds-pharma-chat-bubble:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Chat Toggle Bubble */
#lds-pharma-chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(40, 83, 107, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
    border: none;
}

#lds-pharma-chat-bubble:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 15px 35px rgba(40, 83, 107, 0.5),
        inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

#lds-pharma-chat-bubble svg {
    fill: #ffffff;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

#lds-pharma-chat-bubble:hover svg {
    transform: rotate(-10deg);
}

.pulse-animation {
    animation: premium-pulse 2.5s infinite;
}

@keyframes premium-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 83, 107, 0.6), 0 10px 25px rgba(40, 83, 107, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(40, 83, 107, 0), 0 10px 25px rgba(40, 83, 107, 0.4);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 83, 107, 0), 0 10px 25px rgba(40, 83, 107, 0.4);
    }
}

/* Chat Window Panel */
#lds-pharma-chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: min(380px, calc(100vw - 60px));
    height: 640px;
    max-height: calc(100vh - 120px);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    box-shadow: var(--shadow-soft),
        0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    transform-origin: bottom right;
    visibility: visible;
}

#lds-pharma-chat-window.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    visibility: hidden;
}

/* Header Area */
.chat-header {
    padding: 15px 18px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-avatar {
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-avatar svg {
    width: 22px;
    height: 22px;
    color: black;

}

.chat-title-group {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 600;
    font-size: 18px;
    color: #000000;
    letter-spacing: -0.2px;
}

.chat-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Chat Messages Area */
#lds-pharma-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent;
    scroll-behavior: smooth;
}

#lds-pharma-chat-messages::-webkit-scrollbar {
    width: 5px;
}

#lds-pharma-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#lds-pharma-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
    transition: background 0.3s ease;
}

#lds-pharma-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
    border: 3px solid transparent;
    background-clip: content-box;
}

/* Message Bubbles */
.message {
    padding: 14px 18px;
    border-radius: 20px;
    max-width: 82%;
    font-size: 14px;
    line-height: 1.6;
    animation: messageReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    word-wrap: break-word;
}

@keyframes messageReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.assistant-message {
    background: #ffffff;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.assistant-message ul {
    margin-top: 8px;
    padding-left: 18px;
}

.assistant-message li {
    margin-bottom: 4px;
}

.user-message {
    background: var(--primary-bg);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 6px 16px rgba(40, 83, 107, 0.25);
}

/* Quick Actions Area */
#lds-pharma-quick-actions {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: transparent;
}

.quick-action-btn {
    background: #4f46e5;
    border: 1px solid #3f4f77d4;
    color: var(--primary-solid);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.quick-action-btn:hover {
    background: var(--primary-bg);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 83, 107, 0.3);
}

/* Input Area */
.chat-input-area {
    padding: 16px 20px 20px;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    gap: 12px;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

#lds-pharma-chat-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 14px 18px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

#Visole-chat-input:focus {
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px var(--primary-light), 0 2px 6px rgba(0, 0, 0, 0.02);
}

#lds-pharma-chat-input::placeholder {
    color: #94a3b8;
    font-weight: 300;
}

#lds-pharma-chat-send {
    background: var(--primary-bg);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(40, 83, 107, 0.3);
}

#Visole-chat-send svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    margin-left: -2px;
}

#Visole-chat-input:not(:placeholder-shown)+#Visole-chat-send,
#Visole-chat-send:active {
    transform: scale(0.95);
}

#lds-pharma-chat-send:hover:not(:disabled) {
    transform: scale(1.05) translateY(-2px);
    background: linear-gradient(135deg, #28536b, #f37021);
    box-shadow: 0 8px 20px rgba(40, 83, 107, 0.4);
}

#lds-pharma-chat-send:disabled, 
#lds-pharma-chat-input:disabled, 
.quick-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Typing Indicator Enhancement */
.typing-indicator {
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    animation: messageReveal 0.3s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.typing-indicator span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--primary-solid);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Media Queries */
@media (max-width: 480px) {
    #lds-pharma-chat-wrapper {
        bottom: 0;
        right: 0;
        width: 100%;
    }

    #lds-pharma-chat-bubble {
        bottom: 20px;
        right: 20px;
        position: fixed;
    }

    #lds-pharma-chat-window {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-input-area {
        border-radius: 0;
        padding-bottom: 30px; /* Safe area for some mobile browsers */
    }
}

/* ==========================================================
   Admin Settings Enhancements
   ========================================================== */
.lds-pharma-admin-wrap {
    max-width: 800px;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03), 0 2px 10px rgba(0, 0, 0, 0.02);
    margin-top: 40px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.lds-pharma-admin-wrap h1 {
    color: var(--text-dark);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.lds-pharma-admin-wrap .form-table th {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.lds-pharma-admin-wrap input[type="text"],
.lds-pharma-admin-wrap input[type="password"],
.lds-pharma-admin-wrap select,
.lds-pharma-admin-wrap textarea {
    width: 100%;
    max-width: 480px;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.lds-pharma-admin-wrap input:focus,
.lds-pharma-admin-wrap select:focus,
.lds-pharma-admin-wrap textarea:focus {
    outline: none;
    border-color: var(--primary-solid);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.lds-pharma-admin-wrap .button-primary {
    background: var(--primary-bg) !important;
    border: none !important;
    padding: 12px 32px !important;
    height: auto !important;
    font-size: 15px !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(40, 83, 107, 0.25) !important;
    transition: all 0.3s ease !important;
}

.lds-pharma-admin-wrap .button-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px rgba(40, 83, 107, 0.35) !important;
}