#chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

#chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

#chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.7);
}

#chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--dark);
}

#chat-box {
    width: 320px;
    height: 420px;
    background: var(--darker);
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-header {
    background: var(--primary);
    padding: 14px 16px;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.chat-header-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.chat-header-status {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}

.chat-msg {
    max-width: 80%;
    display: flex;
}

.chat-msg span {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg.admin {
    align-self: flex-start;
}

.chat-msg.admin span {
    background: rgba(139, 92, 246, 0.15);
    color: var(--light);
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
}

.chat-msg.user span {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

#chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--light);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

#chat-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

#chat-send {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    cursor: pointer;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

#chat-send:hover {
    background: var(--primary-dark);
}
