/* THSF ChatBot Styles */

.thsf-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chatbot Toggle Button */
.thsf-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
    overflow: hidden;
}

/* Hezarfen Avatar Styles */
.hezarfen-toggle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.hezarfen-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hezarfen-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hezarfen-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.hezarfen-subtitle {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

.hezarfen-message-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.thsf-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.thsf-chatbot-toggle svg {
    width: 24px;
    height: 24px;
}

/* Chatbot Window */
.thsf-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #FFFFFF;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.thsf-chatbot-window.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chatbot Header */
.thsf-chatbot-header {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.thsf-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* TTS Controls */
.thsf-chatbot-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thsf-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.thsf-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chatbot Messages */
.thsf-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.thsf-chatbot-message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.thsf-chatbot-message.thsf-chatbot-user {
    flex-direction: row-reverse;
}

.thsf-chatbot-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.thsf-chatbot-bot .thsf-chatbot-avatar {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
}

.thsf-chatbot-user .thsf-chatbot-avatar {
    background: #e9ecef;
    color: #495057;
}

.thsf-chatbot-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.thsf-chatbot-user .thsf-chatbot-text {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    border: none;
}


/* Typing Indicator */
.thsf-chatbot-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.thsf-chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b71c1c;
    animation: typing 1.4s infinite ease-in-out;
}

.thsf-chatbot-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.thsf-chatbot-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chatbot Input */
.thsf-chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    align-items: center;
}

.thsf-chatbot-input input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.thsf-chatbot-input input:focus {
    border-color: #b71c1c;
    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.12);
}

.thsf-chatbot-input button {
    background: #FFFFFF;
    color: #333333;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.thsf-chatbot-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.thsf-chatbot-input button:active {
    transform: translateY(0);
}

/* Scrollbar Styling */
.thsf-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.thsf-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thsf-chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.thsf-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 480px) {
    .thsf-chatbot-window {
        width: calc(100vw - 40px);
        right: -10px;
        bottom: 70px;
    }
    
    .thsf-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    .thsf-chatbot-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .thsf-chatbot-header h3 {
        font-size: 14px;
    }
    
    .thsf-tts-toggle {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .thsf-chatbot-text {
        max-width: 80%;
        font-size: 13px;
    }
}

/* Force light theme: remove dark-mode overrides */