:root {
    --primary-color: #368DD3;
    --primary-hover: #132D96;
    --bg-gradient: linear-gradient(135deg, #368DD3 0%, #132D96 100%);
    --chat-bg: rgba(255, 255, 255, 0.85);
    --bot-msg-bg: #f3f4f6;
    --user-msg-bg: #368DD3;
    --user-msg-text: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --glass-blur: blur(12px);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Widget Launcher */
#ici-chat-widget-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--bg-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-premium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9999;
}

#ici-chat-widget-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 25px 30px -5px rgba(99, 102, 241, 0.4);
}

#ici-chat-widget-launcher svg {
    width: 30px;
    height: 30px;
    color: white;
}

/* Chat Container */
#ici-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--chat-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 9998;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ici-chat-container.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.ici-chat-header {
    padding: 20px;
    background: var(--bg-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ici-chat-header .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.ici-chat-header .info h3 {
    font-size: 16px;
    font-weight: 600;
}

.ici-chat-header .info p {
    font-size: 12px;
    opacity: 0.8;
}

/* Messages Area */
.ici-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ici-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    animation: messageIn 0.3s ease-out;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ici-message ul {
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 10px;
}

.ici-message li {
    margin-bottom: 4px;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ici-message.bot {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.ici-message.user {
    align-self: flex-end;
    background: var(--user-msg-bg);
    color: var(--user-msg-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

/* Footer Container */
.ici-chat-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

.ici-input-wrapper {
    display: flex;
    background: #f9fafb;
    border-radius: 12px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s;
}

.ici-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.ici-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 14px;
    outline: none;
}

.ici-send-btn {
    background: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s;
}

.ici-send-btn:hover {
    background: var(--primary-hover);
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bot-msg-bg);
    border-radius: 18px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}