/* AI Chatbot Component Styles - ORTECO Fleet Management */

/* ========================================
   CHATBOT FLOATING BUTTON
   ======================================== */
.ai-chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(94, 138, 61, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(94, 138, 61, 0.5);
}

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

.ai-chatbot-trigger i {
    font-size: 28px;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.ai-chatbot-trigger.active i {
    transform: rotate(90deg);
}

/* Pulse animation for attention */
.ai-chatbot-trigger::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: chatbot-pulse 2s ease-out infinite;
    z-index: -1;
}

@keyframes chatbot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ai-chatbot-trigger.active::before {
    animation: none;
}

/* ========================================
   CHATBOT PANEL
   ======================================== */
.ai-chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    height: 720px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 1999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chatbot-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ========================================
   CHATBOT HEADER
   ======================================== */
.ai-chatbot-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--green-dark) 0%, #3d453c 100%);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.ai-chatbot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-chatbot-avatar i {
    font-size: 24px;
    color: #ffffff;
}

.ai-chatbot-info {
    flex: 1;
}

.ai-chatbot-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

.ai-chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

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

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ai-chatbot-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-chatbot-close i {
    font-size: 20px;
    color: #ffffff;
}

/* ========================================
   CHATBOT MESSAGES AREA
   ======================================== */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Custom scrollbar */
.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Message bubbles */
.ai-chatbot-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: message-appear 0.3s ease-out;
}

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

.ai-chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chatbot-message.bot {
    align-self: flex-start;
}

.ai-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chatbot-message.bot .ai-chatbot-message-avatar {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
}

.ai-chatbot-message.bot .ai-chatbot-message-avatar i {
    font-size: 16px;
    color: #ffffff;
}

.ai-chatbot-message.user .ai-chatbot-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-chatbot-message.user .ai-chatbot-message-avatar i {
    font-size: 16px;
    color: #ffffff;
}

.ai-chatbot-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-chatbot-message.bot .ai-chatbot-message-bubble {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ai-chatbot-message.user .ai-chatbot-message-bubble {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 2px 8px rgba(94, 138, 61, 0.3);
}

.ai-chatbot-message-time {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.ai-chatbot-message.user .ai-chatbot-message-time {
    text-align: right;
}

/* Typing indicator */
.ai-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.ai-chatbot-typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chatbot-typing-avatar i {
    font-size: 16px;
    color: #ffffff;
}

.ai-chatbot-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 16px 16px 16px 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ai-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-primary);
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.ai-chatbot-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-chatbot-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   QUICK ACTIONS / SUGGESTIONS
   ======================================== */
.ai-chatbot-suggestions {
    padding: 12px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.ai-chatbot-suggestions-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.ai-chatbot-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chatbot-suggestion {
    padding: 8px 14px;
    background: rgba(94, 138, 61, 0.08);
    border: 1px solid rgba(94, 138, 61, 0.2);
    border-radius: 20px;
    font-size: 13px;
    color: var(--green-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-chatbot-suggestion:hover {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-chatbot-suggestion i {
    margin-right: 6px;
    font-size: 14px;
}

/* ========================================
   CHATBOT INPUT AREA
   ======================================== */
.ai-chatbot-input-area {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.ai-chatbot-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f5f5f5;
    border-radius: 16px;
    padding: 8px 8px 8px 16px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.ai-chatbot-input-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 4px rgba(94, 138, 61, 0.1);
}

.ai-chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    min-height: 24px;
    line-height: 1.5;
    outline: none;
    padding: 4px 0;
}

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

.ai-chatbot-input-actions {
    display: flex;
    gap: 4px;
}

.ai-chatbot-attach-btn,
.ai-chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chatbot-attach-btn {
    background: transparent;
    color: var(--text-secondary);
}

.ai-chatbot-attach-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.ai-chatbot-send-btn {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(94, 138, 61, 0.3);
}

.ai-chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(94, 138, 61, 0.4);
}

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

.ai-chatbot-send-btn:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.ai-chatbot-send-btn i,
.ai-chatbot-attach-btn i {
    font-size: 20px;
}

/* ========================================
   CHATBOT FOOTER
   ======================================== */
.ai-chatbot-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.02);
    text-align: center;
    flex-shrink: 0;
}

.ai-chatbot-footer-text {
    font-size: 11px;
    color: var(--text-secondary);
}

.ai-chatbot-footer-text i {
    margin-right: 4px;
    color: var(--green-primary);
}

/* ========================================
   WELCOME MESSAGE
   ======================================== */
.ai-chatbot-welcome {
    text-align: center;
    padding: 20px;
}

.ai-chatbot-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-success) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(94, 138, 61, 0.3);
}

.ai-chatbot-welcome-icon i {
    font-size: 32px;
    color: #ffffff;
}

.ai-chatbot-welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 8px;
}

.ai-chatbot-welcome-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .ai-chatbot-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 90px;
        height: calc(100vh - 120px);
        max-height: none;
        border-radius: 16px;
    }

    .ai-chatbot-trigger {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }

    .ai-chatbot-trigger i {
        font-size: 24px;
    }

    .ai-chatbot-header {
        padding: 16px 20px;
    }

    .ai-chatbot-messages {
        padding: 16px;
    }

    .ai-chatbot-suggestions {
        padding: 10px 16px;
    }

    .ai-chatbot-suggestion {
        padding: 6px 12px;
        font-size: 12px;
    }

    .ai-chatbot-input-area {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .ai-chatbot-panel {
        width: 100vw;
        right: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .ai-chatbot-trigger {
        right: 12px;
        bottom: 12px;
    }
}

/* ========================================
   DARK MODE SUPPORT (Future)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Can be expanded for dark mode support */
}
