/* ===========================
   AI Chatbot Styles
   =========================== */

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(100, 255, 218, 0.4);
    transition: var(--transition);
    z-index: 1001;
    animation: pulse 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 35px rgba(100, 255, 218, 0.6);
}

.chatbot-button.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

.chatbot-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    font-size: 9px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
    white-space: nowrap;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(100, 255, 218, 0.4);
    }
    50% {
        box-shadow: 0 5px 35px rgba(100, 255, 218, 0.7);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background-color: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1002;
    overflow: hidden;
}

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

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    padding: 20px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--bg-primary);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chatbot-header-info h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
    font-family: 'Courier New', monospace;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #50fa7b;
    animation: blink 2s infinite;
}

.chatbot-header-actions {
    display: flex;
    gap: 10px;
}

.chatbot-header-actions button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
    width: 30px;
    height: 30px;
    border-radius: 5px;
}

.chatbot-header-actions button:hover {
    color: var(--accent-primary);
    background-color: rgba(100, 255, 218, 0.1);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--bg-primary);
}

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

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

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

/* Welcome Message */
.chatbot-welcome {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(100, 255, 218, 0.2);
    text-align: center;
}

.terminal-prompt-chat {
    font-family: 'Courier New', monospace;
    color: var(--terminal-green);
    font-size: 12px;
    margin-bottom: 10px;
}

.chatbot-welcome p {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.quick-action {
    background-color: var(--bg-primary);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Courier New', monospace;
}

.quick-action:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: rgba(100, 255, 218, 0.05);
    transform: translateY(-2px);
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

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

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

.user-message .message-avatar {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: var(--bg-primary);
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 10px;
    line-height: 1.6;
}

.user-message .message-content {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border-radius: 10px 10px 0 10px;
}

.bot-message .message-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 10px 10px 10px 0;
}

.message-content p {
    margin: 0;
    font-size: 14px;
}

/* Typing Indicator */
.typing-indicator .message-content {
    padding: 15px 20px;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-top: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 0 0 15px 15px;
}

.chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.suggestion-item {
    background-color: var(--bg-primary);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: 'Courier New', monospace;
}

.suggestion-item:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: rgba(100, 255, 218, 0.05);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    background-color: var(--bg-primary);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    transition: var(--transition);
}

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

#chatbot-input::placeholder {
    color: var(--text-secondary);
}

#chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: var(--bg-primary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(100, 255, 218, 0.4);
}

#chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-footer {
    text-align: center;
    margin-top: 10px;
}

.chatbot-footer span {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 10px;
    }

    .chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Bot Suggestions (after messages) */
.bot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.bot-suggestions .quick-action {
    font-size: 11px;
    padding: 6px 12px;
    margin: 0;
}

/* Question Counter */
#question-counter {
    color: var(--accent-primary);
    font-weight: bold;
}

/* Mode Indicator */
#chatbot-mode {
    transition: var(--transition);
}

/* Dark mode enhancement */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    }
}
