/* SINTALIS - AI Chatbot Styles */

/* ============================================
   CHATBOT TOGGLE BUTTON
   ============================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(3, 54, 109, 0.3);
    transition: all var(--transition-speed);
    z-index: 9998;
    animation: pulse 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(3, 54, 109, 0.5);
}

.chatbot-toggle-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(3, 54, 109, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(3, 54, 109, 0.3), 0 0 0 10px rgba(3, 54, 109, 0.1);
    }
}

/* ============================================
   CHATBOT MODAL
   ============================================ */
.chatbot-modal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 4rem);
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

.chatbot-modal.active {
    display: flex;
}

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

/* ============================================
   CHATBOT HEADER
   ============================================ */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.chatbot-header-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-white);
}

.chatbot-status {
    font-size: 0.8125rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ============================================
   CHATBOT MESSAGES
   ============================================ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f9fa;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chatbot-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlide 0.3s ease-out;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bot-message .message-avatar {
    background: var(--primary-color);
    padding: 4px;
}

.bot-message .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.user-message .message-avatar {
    background: var(--gold);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.message-content {
    flex: 1;
    max-width: 75%;
}

.message-content p {
    background: var(--bg-white);
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.user-message .message-content {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-content p {
    background: var(--primary-color);
    color: var(--text-white);
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.chatbot-typing {
    padding: 0 1.5rem 1rem;
    background: #f8f9fa;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.875rem 1rem;
    background: var(--bg-white);
    border-radius: 1rem;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

.typing-indicator 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;
    }
}

/* ============================================
   CHATBOT INPUT AREA
   ============================================ */
.chatbot-input-area {
    padding: 1rem 1.5rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
}

.chatbot-form {
    display: flex;
    gap: 0.75rem;
}

.chatbot-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 1.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-speed);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .chatbot-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .chatbot-modal {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }
}
