/* ── Base widget ── */
#chatics-widget {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.chatics-position-right { right: 24px; }
.chatics-position-left  { left: 24px; }

/* ── Toggle button ── */
#chatics-toggle {
    min-width: 64px;
    min-height: 64px;
    border-radius: 50px;
    border: none;
    background-color: #00b894;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,184,148,0.45);
    padding: 0 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.3px;
}
#chatics-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,184,148,0.55);
}
#chatics-toggle svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    flex-shrink: 0;
}
#chatics-toggle img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

/* ── Teaser bubble (auto-popup hook) ── */
#chatics-teaser {
    position: fixed;
    bottom: 104px;
    background: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 14px 18px;
    max-width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a2e;
    z-index: 99998;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    cursor: pointer;
}
#chatics-teaser.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#chatics-teaser strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #00b894;
}
#chatics-teaser .chatics-teaser-close {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 16px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}
.chatics-position-right #chatics-teaser { right: 24px; }
.chatics-position-left  #chatics-teaser { left: 24px; }

/* ── Chat window ── */
#chatics-frame-wrapper {
    position: fixed;
    bottom: 104px;
    width: 400px;
    height: 620px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    background: #fff;
    display: none;
    flex-direction: column;
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}
#chatics-frame-wrapper.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.chatics-position-right #chatics-frame-wrapper { right: 24px; }
.chatics-position-left  #chatics-frame-wrapper { left: 24px; }

#chatics-frame-wrapper iframe {
    border: none;
    width: 100%;
    height: 100%;
    flex: 1;
}

/* ── Header ── */
#chatics-header {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: #fff;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chatics-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatics-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.chatics-header-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.chatics-header-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.2px;
}
.chatics-header-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chatics-header-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #55efc4;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.chatics-header-buttons {
    display: flex;
    gap: 4px;
}
#chatics-fullscreen,
#chatics-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.2s;
}
#chatics-fullscreen:hover,
#chatics-close:hover {
    background: rgba(255,255,255,0.28);
}

/* ── Fullscreen ── */
#chatics-frame-wrapper.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
}
#chatics-frame-wrapper.fullscreen iframe {
    height: calc(100vh - 64px) !important;
}

/* ── Overlay ── */
#chatics-overlay {
    display: none;
    position: fixed;
    inset: 0;
    
    z-index: 99997;
    
}
#chatics-overlay.show { display: block; }

/* ── Notification dot ── */
#chatics-notif-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: #ff5252;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    animation: chatics-pulse 1.5s infinite;
}
@keyframes chatics-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,82,82,0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(255,82,82,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,82,82,0); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #chatics-frame-wrapper {
        width: 100vw !important;
        height: 100vh !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
    }
    #chatics-teaser { max-width: 220px; }
}
