/*
 * Chat Component Styles
 */

/* Chatbot Sidebar */
.chatbot-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.chatbot-sidebar.open {
    right: 0;
}

/* Chat Sidebar Header */
.chat-sidebar-header {
    background: var(--color-card-bg);
    color: white;
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header-content-sidebar {
    flex: 1;
    position: relative;
    z-index: 1;
}

.header-content-sidebar h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.header-content-sidebar p {
    opacity: 0.9;
    font-size: 13px;
}

.close-sidebar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages-sidebar {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message */
.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.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: 16px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: var(--color-primary);
    color: white;
}

.message.user .message-avatar {
    background: var(--color-primary);
    color: white;
}

.message-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 14px;
}

.message.bot .message-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.message.user .message-content {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

/* Development Notice */
.development-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-size: 12px;
    color: #8b5a00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.development-notice .icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Tool Recommendation */
.tool-recommendation {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-recommendation:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

.tool-name {
    font-weight: 700;
    color: #4f46e5;
    font-size: 14px;
    margin-bottom: 6px;
}

.tool-description {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 6px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-chip {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.suggestion-chip:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Chat Input Container */
.chat-input-container-sidebar {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: all 0.3s ease;
    max-height: 100px;
    min-height: 44px;
}

.chat-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 50px;
    justify-content: center;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Scrollbar */
.chat-messages-sidebar::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Floating Chat Button */
.floating-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-chat-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    width: 70px;
    height: 70px;
}

.btn-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-icon, .robot-icon {
    position: absolute;
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
}

.robot-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

.floating-chat-btn:hover .chat-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

.floating-chat-btn:hover .robot-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Pulse Animation */
.pulse-ring, .pulse-ring-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

.pulse-ring {
    animation: pulse 2s infinite;
}

.pulse-ring-2 {
    animation: pulse 2s infinite 1s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Chat Button Text */
.chat-btn-text {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid #e0e0e0;
    min-width: 200px;
}

.chat-btn-text span {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.chat-btn-text small {
    color: #666;
    font-size: 12px;
}

.floating-chat-container:hover .chat-btn-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-10px);
}

/* Chat Tooltip */
.chat-tooltip {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 20px;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.tooltip-content .tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.tooltip-header i {
    font-size: 20px;
    color: #667eea;
    margin-right: 8px;
}

.tooltip-header span {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.tooltip-content p {
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.tooltip-examples {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.tooltip-examples small {
    color: #666;
    font-style: italic;
    line-height: 1.3;
}

.floating-chat-container:hover .chat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.5s;
}