/* Text-Based Live Chat Styles */

.text-chat-widget {
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 1001;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.text-chat-trigger {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-chat-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.text-chat-trigger.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.text-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1002;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.text-chat-window.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.text-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.text-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.text-chat-close:hover {
    opacity: 1;
}

.text-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    gap: 10px;
    animation: slideInUp 0.3s ease;
}

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

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

.message-avatar.bot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-avatar.user {
    background: #f1f3f4;
    color: #666;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message-content.bot {
    background: #f1f3f4;
    color: #333;
}

.message-content.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-content .play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.message-content .play-btn:hover {
    opacity: 1;
}

.text-chat-input-area {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.text-chat-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    max-height: 80px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.text-chat-input:focus {
    border-color: #667eea;
}

.text-chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.text-chat-send:hover:not(:disabled) {
    transform: scale(1.1);
}

.text-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f1f3f4;
    border-radius: 18px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .text-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 20px;
        left: 20px;
    }
    
    .text-chat-trigger {
        bottom: 20px;
        right: 20px;
    }
}

/* Auto-speak indicator */
.auto-speak-status {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.audio-playing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        background: rgba(102, 126, 234, 0.1);
    }
    50% {
        background: rgba(102, 126, 234, 0.2);
    }
}