/* UI Enhancements Styles */

/* Enhanced thinking indicator */
.thinking-indicator.enhanced {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 12px 0;
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(59, 130, 246, 0.1);
    padding: 12px 20px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.ai-avatar {
    font-size: 24px;
    animation: bounce 1.5s infinite;
}

.thinking-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.thinking-text {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Message actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Floating action buttons */
.floating-actions {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.fab {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.9);
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fab:hover {
    transform: scale(1.1);
    background: rgba(59, 130, 246, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Character counter */
.char-counter {
    position: absolute;
    bottom: -20px;
    right: 60px;
    font-size: 11px;
    color: #888;
    transition: color 0.3s ease;
}

/* Keyboard shortcuts hint */
.keyboard-shortcuts {
    position: absolute;
    bottom: -25px;
    left: 20px;
    font-size: 11px;
    color: #666;
}

.shortcut-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: monospace;
    font-size: 10px;
}

/* Spinning animation for send button */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* Enhanced message animations */
.message {
    animation: messageSlide 0.4s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.user {
    animation: messageSlideRight 0.4s ease-out;
}

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

/* Better scrollbar */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Message hover effects */
.message {
    transition: all 0.3s ease;
}

.message:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Improved input area */
.input-wrapper {
    position: relative;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.message-input {
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-dot.online {
    background: #10b981;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .floating-actions {
        bottom: 80px;
        right: 15px;
    }
    
    .fab {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .keyboard-shortcuts {
        display: none;
    }
}