/* AI Help Bot Styling */

.ai-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    font-family: var(--font-main);
}

.ai-bot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.ai-bot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ai-bot-trigger i {
    z-index: 2;
}

.ai-bot-trigger::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform-origin: bottom right;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    overflow: hidden;
}

.ai-chat-window.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.ai-chat-header {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.ai-chat-header .badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
}

.ai-chat-header .badge-warning {
    background: #f59e0b;
    /* Amber/Orange */
    font-weight: bold;
}

/* AI Bot Trainer Styles (Admin Section) */
.admin-bot-training .admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.admin-bot-training .form-input {
    width: 100% !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    padding: var(--space-md) !important;
    border-radius: var(--radius-md) !important;
    font-family: inherit !important;
    font-size: var(--font-size-sm) !important;
    resize: vertical !important;
    min-height: 100px;
}

/* AI Bot Mobile Adjustments */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 0;
    }

    .ai-bot-trigger {
        width: 55px;
        height: 55px;
        bottom: 85px;
        left: 20px;
        right: auto;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    }

    .ai-chat-window {
        width: 100vw;
        height: calc(100vh - 70px);
        bottom: 70px;
        left: 0;
        right: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

.ai-chat-messages {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: rgba(0, 0, 0, 0.1);
}

.chat-message {
    max-width: 85%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    position: relative;
}

.message-ai {
    align-self: flex-start;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.message-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.ai-chat-input {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-sm);
}

.ai-chat-input input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    outline: none;
}

.ai-chat-input input:focus {
    border-color: var(--primary);
}

.ai-chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-input button:hover {
    background: var(--primary-hover);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    from {
        opacity: 0.3;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Scrollbar for chat */
.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}