/* ========================================== */
/* MEDOCS AI Help Widget Styles              */
/* ========================================== */

/* --- Toggle Button --- */
.imehr-help-toggle-btn {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.imehr-help-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.imehr-help-toggle-btn:active {
    transform: scale(0.98);
}

.imehr-help-toggle-btn i {
    font-size: 16px;
}

/* --- Widget Panel --- */
.imehr-help-widget {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 400px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1051;
    overflow: hidden;
    animation: imehrHelpSlideUp 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.imehr-help-widget.open {
    display: flex;
}

@keyframes imehrHelpSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Header --- */
.imehr-help-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    flex-shrink: 0;
}

.imehr-help-header-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

.imehr-help-header-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.imehr-help-header-actions {
    display: flex;
    gap: 4px;
}

.imehr-help-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
}

.imehr-help-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Messages Container --- */
.imehr-help-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.imehr-help-messages::-webkit-scrollbar {
    width: 6px;
}

.imehr-help-messages::-webkit-scrollbar-track {
    background: transparent;
}

.imehr-help-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* --- Welcome Screen --- */
.imehr-help-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 8px;
}

.imehr-help-welcome-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #6366f1;
}

.imehr-help-welcome h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.imehr-help-welcome p {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.imehr-help-welcome-docs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6366f1;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.15s;
}

.imehr-help-welcome-docs:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.imehr-help-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.imehr-help-suggestion-btn {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #374151;
    transition: all 0.15s;
    font-family: inherit;
}

.imehr-help-suggestion-btn:hover {
    background: #f0f0ff;
    border-color: #6366f1;
    color: #4f46e5;
}

/* --- Message Bubbles --- */
.imehr-help-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
}

.imehr-help-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.imehr-help-msg-ai {
    align-self: flex-start;
}

.imehr-help-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.imehr-help-msg-user .imehr-help-msg-avatar {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.imehr-help-msg-ai .imehr-help-msg-avatar {
    background: #e5e7eb;
    color: #4b5563;
}

.imehr-help-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.imehr-help-msg-user .imehr-help-msg-bubble {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-bottom-right-radius: 4px;
}

.imehr-help-msg-ai .imehr-help-msg-bubble {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.imehr-help-msg-ai .imehr-help-msg-bubble p {
    margin: 0 0 8px;
}

.imehr-help-msg-ai .imehr-help-msg-bubble p:last-child {
    margin-bottom: 0;
}

.imehr-help-msg-ai .imehr-help-msg-bubble ol,
.imehr-help-msg-ai .imehr-help-msg-bubble ul {
    margin: 4px 0;
    padding-left: 20px;
}

.imehr-help-msg-ai .imehr-help-msg-bubble li {
    margin-bottom: 4px;
}

.imehr-help-msg-ai .imehr-help-msg-bubble strong {
    font-weight: 600;
}

/* --- Feature Request Prompt --- */
.imehr-help-feature-prompt {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 4px 0;
}

.imehr-help-feature-prompt p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #1e40af;
}

.imehr-help-feature-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.15s;
    font-family: inherit;
}

.imehr-help-feature-btn:hover {
    background: #2563eb;
}

/* --- Typing Indicator --- */
.imehr-help-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}

.imehr-help-typing.active {
    display: flex;
}

.imehr-help-typing-dots {
    display: flex;
    gap: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 14px;
}

.imehr-help-typing-dot {
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: imehrTypingBounce 1.2s infinite ease-in-out;
}

.imehr-help-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.imehr-help-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes imehrTypingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* --- Input Area --- */
.imehr-help-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
}

.imehr-help-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.imehr-help-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.imehr-help-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.imehr-help-input::placeholder {
    color: #9ca3af;
}

.imehr-help-send-btn {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.imehr-help-send-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.imehr-help-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.imehr-help-powered {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

/* --- Mobile Responsive --- */
@media (max-width: 576px) {
    .imehr-help-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .imehr-help-toggle-btn {
        bottom: 16px;
        right: 16px;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .imehr-help-widget {
        animation: none;
    }

    .imehr-help-toggle-btn {
        transition: none;
    }

    .imehr-help-typing-dot {
        animation: none;
        opacity: 0.6;
    }
}
