/* Chat Widget Styles */
:root {
    --hmeonot-chat-primary: #0073aa;
    --hmeonot-chat-secondary: #005177;
}

/* Widget Container */
.hmeonot-chat-widget {
    position: fixed;
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    direction: rtl;
}

.hmeonot-chat-widget.position-right-center {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hmeonot-chat-widget.position-right-bottom {
    right: 20px;
    bottom: 20px;
}

.hmeonot-chat-widget.position-left-center {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hmeonot-chat-widget.position-left-bottom {
    left: 20px;
    bottom: 20px;
}

/* Chat Button */
.hmeonot-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--hmeonot-chat-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.hmeonot-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hmeonot-chat-button .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hmeonot-chat-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulse Animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 115, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0); }
}

.hmeonot-chat-button.pulse {
    animation: pulse 3s infinite;
}

/* Chat Window */
.hmeonot-chat-window {
    display: none;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
}

.hmeonot-chat-window.open {
    display: flex;
}

/* Header */
.hmeonot-chat-header {
    background: var(--hmeonot-chat-primary);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hmeonot-chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.hmeonot-chat-header .info {
    flex: 1;
}

.hmeonot-chat-header .name {
    font-weight: 600;
    font-size: 14px;
}

.hmeonot-chat-header .status {
    font-size: 12px;
    opacity: 0.9;
}

.hmeonot-chat-header .actions {
    display: flex;
    gap: 8px;
}

.hmeonot-chat-header .actions button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.hmeonot-chat-header .actions button:hover {
    opacity: 1;
}

/* Messages */
.hmeonot-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.hmeonot-chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.hmeonot-chat-message.user {
    align-self: flex-start;
    background: var(--hmeonot-chat-secondary);
    color: white;
    border-bottom-right-radius: 4px;
}

.hmeonot-chat-message.ai {
    align-self: flex-end;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hmeonot-chat-message a {
    color: inherit;
    text-decoration: underline;
}

/* Typing Indicator */
.hmeonot-chat-typing {
    display: none;
    align-self: flex-end;
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hmeonot-chat-typing.visible {
    display: block;
}

.hmeonot-chat-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1s infinite;
}

.hmeonot-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.hmeonot-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input */
.hmeonot-chat-input {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: white;
}

.hmeonot-chat-input textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    max-height: 100px;
    direction: rtl;
}

.hmeonot-chat-input textarea:focus {
    outline: none;
    border-color: var(--hmeonot-chat-primary);
}

.hmeonot-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hmeonot-chat-input .send-btn {
    background: var(--hmeonot-chat-primary);
    color: white;
}

.hmeonot-chat-input .send-btn:hover {
    background: var(--hmeonot-chat-secondary);
}

.hmeonot-chat-input .upload-btn {
    background: #f8f9fa;
    color: #666;
}

.hmeonot-chat-input .upload-btn:hover {
    background: #e9ecef;
}

/* Scrollbar */
.hmeonot-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.hmeonot-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.hmeonot-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Disclaimer */
.hmeonot-chat-disclaimer {
    padding: 8px 15px;
    background: #f8f9fa;
    font-size: 11px;
    color: #666;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

/* Dragging */
.hmeonot-chat-widget.dragging {
    cursor: grabbing;
}

.hmeonot-chat-widget.dragging .hmeonot-chat-button {
    cursor: grabbing;
}
