:root {
    --primary: #6945ff;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --dark-bg: #181717;
    --darker-bg: #0b1120;
    --light-bg: #f0f0f0;
    --card-bg: #151b25;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --sidebar-width: 350px;
}
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: transparent;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
}

.chat-button:hover {
    transform: scale(1.1);
}

/* لرزش */
.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-2px, 0) rotate(-3deg); }
    40% { transform: translate(2px, 0) rotate(3deg); }
    60% { transform: translate(-2px, 0) rotate(-3deg); }
    80% { transform: translate(2px, 0) rotate(3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 480px;
    height: 75dvh;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-header {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    font-weight: bold;
    text-align: center;
    position: relative;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 1rem;
    padding: 10px ;
    outline: none;
    width: 100%;
    font-size: 13.5px;
    height: 45px;
}

.send-button {
    margin-top: 10px;
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 1rem;
    padding: 8px 15px;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner-container {
    display: none;
    position: absolute;
}
.htmx-request .spinner-container {
    display: inline-block;
}
.htmx-request .button-text {
    visibility: hidden;
}
.htmx-request .send-button {
    cursor: not-allowed;
    opacity: 0.8;
}
.htmx-request .chat-input {
    pointer-events: none;
    opacity: 0.7;
}

.close-button {
    position: absolute;
    left: 15px;
    top: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chat-message {
    display: flex;
    max-width: 70% !important;
    padding: 10px 15px;
    border-radius: 1rem;
    margin-bottom: 5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user {
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 0;
    align-self: flex-start;
    text-align: right;
}
.chat-message.bot {
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 0;
    text-align: right;
}


/* استایل برای نمایش موبایل */
@media (max-width: 768px) {
    .chat-box.mobile-fullscreen {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        z-index: 1001;
    }
    
    .chat-button.mobile-hidden {
        display: none;
    }
}
.message{
    font-size: 14px !important;
}

.close-button{
    transition: all 0.3s;
}
.close-button:hover{
    transform: scale(1.1);
}


.message-content{
    font-size: 14px;
}


.powered-by {
    text-align: center;
    padding: 5px;
    color: #666;
    font-size: 12px;
}



.message-input-container {
    position: relative;
    display: flex;
    width: 100%;
}

.emoji-picker-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    margin-top: 10px;
    
}

.emoji-picker {
    position: absolute;
    bottom: 70px;
   
    background: rgb(250, 250, 250);
    border-radius: 1rem;
    padding: 10px;
    display: none;
    
    width: 200px;
    max-height: 200px;
    align-content: center;
   
}

.emoji-picker.show {
    display: flex;
}

.emoji-option {
    padding: 5px;
    cursor: pointer;
    font-size: 20px;
}

.emoji-option:hover {
    background: #f0f0f0;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f1f1f1;
    border-radius: 18px;
    margin-bottom: 10px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #6c63ff;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
}

.typing-dot:nth-child(1) {
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation: typingAnimation 1.4s infinite 0.2s;
}

.typing-dot:nth-child(3) {
    animation: typingAnimation 1.4s infinite 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

