/* Visitor Widget Styling - Premium White Edition */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --inbox-primary: #6366f1;
    --inbox-primary-light: #818cf8;
    --inbox-bg: #ffffff;
    --inbox-text-main: #0f172a;
    --inbox-text-sub: #64748b;
    --inbox-border: rgba(0, 0, 0, 0.06);
    --inbox-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12);
}

.inbox-widget-container, .inbox-widget-container * {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.inbox-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Premium Squircle FAB */
.inbox-fab {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 24px -6px rgba(99, 102, 241, 0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: none;
    outline: none;
}

.inbox-fab:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.6);
}

.inbox-fab svg {
    color: white;
    width: 30px;
    height: 30px;
    position: absolute;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#inbox-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.inbox-fab.active #inbox-icon-main {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.inbox-fab.active #inbox-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.inbox-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4757;
    color: white;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.4);
    z-index: 10;
}

/* Chat Window - Premium White Card */
.inbox-window {
    position: absolute;
    bottom: 84px;
    right: 0;
    width: 380px;
    height: 620px;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: var(--inbox-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.9) translateY(40px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--inbox-border);
}

.inbox-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header Design */
.inbox-header {
    padding: 28px 24px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 16px;
}

.inbox-header-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.inbox-avatar-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.inbox-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 3px solid white;
    border-radius: 50%;
}

.inbox-header-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--inbox-text-main);
    letter-spacing: -0.3px;
}

.inbox-header-info p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--inbox-text-sub);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Message Area */
.inbox-chat-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fcfcfd;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inbox-chat-body::-webkit-scrollbar { width: 5px; }
.inbox-chat-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.inbox-msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.inbox-msg-visitor { align-self: flex-end; align-items: flex-end; }
.inbox-msg-admin { align-self: flex-start; align-items: flex-start; }

.inbox-bubble {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    transition: all 0.2s;
}

.inbox-msg-visitor .inbox-bubble {
    background: #6366f1;
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.inbox-msg-admin .inbox-bubble {
    background: #ffffff;
    color: var(--inbox-text-main);
    border-radius: 20px 20px 20px 4px;
    border: 1px solid var(--inbox-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.inbox-msg-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Footer & Input */
.inbox-footer {
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid var(--inbox-border);
}

.inbox-input-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.inbox-input-container:focus-within {
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.05);
}

.inbox-textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 14px;
    color: var(--inbox-text-main);
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
}

.inbox-action-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s;
}

.inbox-action-icon:hover {
    color: #6366f1;
    background: #f1f5f9;
}

.inbox-send-btn-new {
    width: 42px;
    height: 42px;
    background: #6366f1;
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.inbox-send-btn-new:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

/* Mobile Responsive Premium */
@media (max-width: 480px) {
    .inbox-widget-container { bottom: 16px; right: 16px; }
    .inbox-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
    }
    .inbox-window.open { transform: translateY(0); }
    .inbox-fab.active { display: none; }
    .inbox-mobile-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    .inbox-header { padding: 40px 24px 20px; }
}

.inbox-mobile-close-btn {
    margin-left: auto;
    cursor: pointer;
    color: #94a3b8;
    padding: 8px;
    border-radius: 12px;
    display: none;
}

@media (max-width: 480px) {
    .inbox-mobile-close-btn { display: block; }
}
