/* ============================================
   HONEST BOT WIDGET - Datadavinci
   Modern chat widget matching site design system
   ============================================ */

:root {
    /* Use site design system colors */
    --bot-primary: #0077b6;
    --bot-primary-dark: #1e4d7b;
    --bot-primary-light: #48cae4;
    --bot-accent: #ff6b35;
    --bot-bg: #ffffff;
    --bot-bg-secondary: #f4f5f7;
    --bot-text: #1a1d23;
    --bot-text-secondary: #5a6072;
    --bot-text-muted: #757b8a;
    --bot-border: #e2e5ea;
    --bot-border-light: #f4f5f7;
    --bot-shadow-sm: 0 2px 8px rgba(26, 29, 35, 0.08);
    --bot-shadow-md: 0 8px 24px rgba(26, 29, 35, 0.12);
    --bot-shadow-lg: 0 16px 48px rgba(26, 29, 35, 0.16);
    --bot-radius-sm: 8px;
    --bot-radius-md: 12px;
    --bot-radius-lg: 20px;
    --bot-radius-full: 9999px;
    --bot-transition: 250ms ease;
    --bot-transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   CHAT BUTTON (FAB)
   ============================================ */

.honest-bot-widget {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.honest-bot-button {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
    border-radius: var(--bot-radius-full);
    background: linear-gradient(145deg, var(--bot-primary) 0%, var(--bot-primary-dark) 100%);
    border: none;
    cursor: pointer;
    box-shadow: var(--bot-shadow-md), 0 0 0 0 rgba(0, 119, 182, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--bot-transition-bounce), box-shadow var(--bot-transition);
    animation: botPulse 3s ease-in-out infinite;
}

.honest-bot-button:hover {
    transform: scale(1.08);
    box-shadow: var(--bot-shadow-lg), 0 0 0 0 rgba(0, 119, 182, 0);
}

.honest-bot-button.active {
    transform: scale(0.92);
    animation: none;
}

.honest-bot-button svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform var(--bot-transition);
}

.honest-bot-button.active svg {
    transform: rotate(90deg) scale(0.9);
}

/* Subtle pulse animation */
@keyframes botPulse {
    0%, 100% {
        box-shadow: var(--bot-shadow-md), 0 0 0 0 rgba(0, 119, 182, 0.4);
    }
    50% {
        box-shadow: var(--bot-shadow-md), 0 0 0 12px rgba(0, 119, 182, 0);
    }
}

/* Stop animation after first interaction */
.honest-bot-button.interacted {
    animation: none;
}

/* ============================================
   CHAT WINDOW
   ============================================ */

.honest-bot-window {
    position: fixed;
    bottom: 108px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 56px);
    max-height: calc(100vh - 140px);
    background: var(--bot-bg);
    border-radius: var(--bot-radius-lg);
    box-shadow: var(--bot-shadow-lg);
    border: 1px solid var(--bot-border-light);
    z-index: 9998;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity var(--bot-transition), transform var(--bot-transition-bounce);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.honest-bot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ============================================
   HEADER
   ============================================ */

.honest-bot-header {
    background: linear-gradient(145deg, var(--bot-primary) 0%, var(--bot-primary-dark) 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.honest-bot-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.honest-bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--bot-radius-md);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.honest-bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.honest-bot-header-text h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.honest-bot-header-text p {
    margin: 2px 0 0 0;
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

.honest-bot-header-text p::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.honest-bot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--bot-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all var(--bot-transition);
}

.honest-bot-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.honest-bot-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   MESSAGE AREA
   ============================================ */

.honest-bot-messages {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: var(--bot-bg);
}

.honest-bot-message {
    background: var(--bot-bg-secondary);
    padding: 20px;
    border-radius: var(--bot-radius-md);
    margin-bottom: 0;
    animation: messageSlideIn 0.5s ease;
    line-height: 1.65;
    color: var(--bot-text);
    border: 1px solid var(--bot-border-light);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.honest-bot-message p {
    margin: 0 0 14px 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--bot-text-secondary);
}

.honest-bot-message p:first-child {
    color: var(--bot-text);
}

.honest-bot-message p:last-of-type {
    margin-bottom: 0;
}

.honest-bot-message strong {
    color: var(--bot-text);
    font-weight: 600;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.honest-bot-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.honest-bot-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bot-bg);
    border: 1.5px solid var(--bot-border);
    border-radius: var(--bot-radius-md);
    text-decoration: none;
    color: var(--bot-text);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--bot-transition);
    cursor: pointer;
}

.honest-bot-action-btn:hover {
    border-color: var(--bot-primary);
    background: rgba(0, 119, 182, 0.04);
    transform: translateX(4px);
    box-shadow: var(--bot-shadow-sm);
}

.honest-bot-action-btn:active {
    transform: translateX(2px);
}

.honest-bot-action-btn .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, var(--bot-primary) 0%, var(--bot-primary-dark) 100%);
    border-radius: var(--bot-radius-sm);
    flex-shrink: 0;
    transition: transform var(--bot-transition);
}

.honest-bot-action-btn:hover .icon {
    transform: scale(1.05);
}

.honest-bot-action-btn .icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.honest-bot-action-btn .text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 2px;
}

.honest-bot-action-btn .text .label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--bot-text);
    letter-spacing: -0.01em;
}

.honest-bot-action-btn .text .description {
    font-size: 12px;
    color: var(--bot-text-muted);
    font-weight: 400;
}

/* Highlight primary action */
.honest-bot-action-btn:first-child {
    border-color: var(--bot-primary);
    background: rgba(0, 119, 182, 0.04);
}

.honest-bot-action-btn:first-child:hover {
    background: rgba(0, 119, 182, 0.08);
}

/* ============================================
   FOOTER
   ============================================ */

.honest-bot-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--bot-border);
    background: var(--bot-bg-secondary);
    text-align: center;
    flex-shrink: 0;
}

.honest-bot-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--bot-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.honest-bot-footer p::before {
    content: '⚡';
    font-size: 11px;
}

.honest-bot-footer a {
    color: var(--bot-primary);
    text-decoration: none;
    font-weight: 600;
}

.honest-bot-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .honest-bot-button {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }

    .honest-bot-button svg {
        width: 26px;
        height: 26px;
    }

    .honest-bot-window {
        bottom: 92px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 120px);
    }

    .honest-bot-header {
        padding: 18px 20px;
    }

    .honest-bot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .honest-bot-header-text h3 {
        font-size: 16px;
    }

    .honest-bot-messages {
        padding: 20px;
        max-height: none;
    }

    .honest-bot-message {
        padding: 18px;
    }

    .honest-bot-action-btn {
        padding: 12px 14px;
    }

    .honest-bot-action-btn .icon {
        width: 36px;
        height: 36px;
    }

    .honest-bot-action-btn .icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

.honest-bot-messages::-webkit-scrollbar {
    width: 6px;
}

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

.honest-bot-messages::-webkit-scrollbar-thumb {
    background: var(--bot-border);
    border-radius: 3px;
}

.honest-bot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bot-text-muted);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.honest-bot-button:focus,
.honest-bot-action-btn:focus,
.honest-bot-close:focus {
    outline: 2px solid var(--bot-primary);
    outline-offset: 2px;
}

.honest-bot-button:focus:not(:focus-visible),
.honest-bot-action-btn:focus:not(:focus-visible),
.honest-bot-close:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   NOTIFICATION BADGE (Future use)
   ============================================ */

.honest-bot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--bot-accent);
    color: white;
    min-width: 22px;
    height: 22px;
    border-radius: var(--bot-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    border: 2px solid white;
    box-shadow: var(--bot-shadow-sm);
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .honest-bot-button {
        animation: none;
    }

    .honest-bot-window,
    .honest-bot-message,
    .honest-bot-action-btn,
    .honest-bot-button {
        transition-duration: 0.01ms !important;
    }
}
