#chatics-widget {
    position: fixed;
    bottom: 30px;
    z-index: 999999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.chatics-position-right { right: 30px; }
.chatics-position-left { left: 30px; }

#chatics-toggle {
    min-width: 64px;
    min-height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--chatics-color, #00b894), color-mix(in srgb, var(--chatics-color) 70%, black));
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 15px rgba(0, 0, 0, 0.05);
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: chatics-float 3s ease-in-out infinite;
}

#chatics-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

#chatics-toggle img {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

#chatics-toggle svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

#chatics-frame-wrapper {
    position: fixed;
    bottom: 110px;
    width: 400px;
    height: 650px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.4) inset;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.chatics-position-left #chatics-frame-wrapper { transform-origin: bottom left; }

#chatics-frame-wrapper.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.chatics-position-right #chatics-frame-wrapper { right: 30px; }
.chatics-position-left #chatics-frame-wrapper { left: 30px; }

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

/* Optional Chat Header - only if you want to inject your own UI */
#chatics-header {
    background: linear-gradient(135deg, var(--chatics-color, #00b894), color-mix(in srgb, var(--chatics-color) 85%, black));
    color: #fff;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.chatics-header-buttons {
    display: flex;
    gap: 8px;
}

#chatics-fullscreen, #chatics-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#chatics-fullscreen:hover, #chatics-close:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

/* Floating close button (when header is disabled) */
#chatics-floating-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

#chatics-floating-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Full-screen mode styles */
#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;
    transform: none !important;
}

#chatics-frame-wrapper.fullscreen iframe {
    height: 100vh !important;
}

/* Iframe height adjustment when header is disabled */
#chatics-frame-wrapper:not(:has(#chatics-header)) iframe,
#chatics-frame-wrapper:not([data-has-header="true"]) iframe {
    height: 100% !important;
}

#chatics-frame-wrapper.fullscreen:not(:has(#chatics-header)) iframe,
#chatics-frame-wrapper.fullscreen:not([data-has-header="true"]) iframe {
    height: 100vh !important;
}

@keyframes chatics-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

@media (max-width: 480px) {
    #chatics-frame-wrapper {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 100px;
        right: 20px !important;
        left: 20px !important;
    }
}
