/* ===== CHATBOT STYLES ===== */
.chatbot-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-modal);
    font-family: var(--font-primary);
}

/* ===== CHATBOT TOGGLE BUTTON ===== */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 1.5rem;
    transition: var(--transition-normal);
    box-shadow: 0 8px 25px var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: var(--transition-normal);
}

.chatbot-toggle:hover::before {
    transform: translateX(100%);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px var(--shadow-glow);
}

.chatbot-toggle.active {
    transform: rotate(180deg);
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
}

.pulse-animation {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* ===== CHATBOT WINDOW ===== */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px var(--shadow-heavy);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(100, 255, 218, 0.03) 0%, 
        rgba(124, 58, 237, 0.03) 100%);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* ===== CHATBOT HEADER ===== */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: relative;
    z-index: 1;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.chatbot-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--shadow-glow);
    position: relative;
}

.bot-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.bot-details h4 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.chatbot-close {
    width: 30px;
    height: 30px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.chatbot-close:hover {
    background: var(--error);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ===== CHATBOT MESSAGES ===== */
.chatbot-messages {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    animation: slideInUp 0.3s ease-out;
}

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.bot-message .message-avatar {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.user-message .message-avatar {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-primary);
}

.message-content {
    max-width: 80%;
    word-wrap: break-word;
}

.message-content p {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.bot-message .message-content p {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-bottom-left-radius: 4px;
}

.bot-message .message-content p::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
}

.user-message .message-content p {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    animation: slideInUp 0.3s ease-out;
}

.typing-indicator .message-avatar {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
    position: relative;
}

.typing-dots::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

/* ===== CHATBOT INPUT ===== */
.chatbot-input {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

.input-container {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.chatbot-input input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.chatbot-input input::placeholder {
    color: var(--text-muted);
}

.send-button {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--shadow-glow);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== QUICK QUESTIONS ===== */
.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.quick-question {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    white-space: nowrap;
}

.quick-question:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.quick-question i {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ===== MESSAGE ACTIONS ===== */
.message-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    opacity: 0;
    transition: var(--transition-fast);
}

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

.action-btn {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.action-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

/* ===== TOOL MODALS ===== */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-tooltip);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.tool-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
    position: relative;
}

.tool-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--error);
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-body input,
.modal-body textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    margin-bottom: var(--spacing-sm);
    transition: var(--transition-normal);
}

.modal-body input:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-md);
}

.modal-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.modal-btn.primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-glow);
}

.modal-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.modal-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .chatbot-window {
        width: 320px;
        height: 450px;
        bottom: 70px;
    }
    
    .quick-questions {
        flex-direction: column;
    }
    
    .quick-question {
        justify-content: flex-start;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .chatbot-window {
        width: 280px;
        height: 400px;
        bottom: 65px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-md);
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* ===== CHAT ANIMATIONS ===== */
.chat-fade-in {
    animation: chatFadeIn 0.5s ease-out;
}

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

.message-bubble-pop {
    animation: bubblePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bubblePop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== ERROR STATES ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--error) !important;
    color: var(--error) !important;
}

.error-message::before {
    background: var(--error) !important;
}

/* ===== SUCCESS STATES ===== */
.success-message {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.success-message::before {
    background: var(--success) !important;
} 