/**
* AI CHATBOT STYLES
* Professional chatbot widget styling
* Responsive and accessible
*/

/* ============================================
  CHATBOT CONTAINER
  ============================================ */
#website-ai-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
  CHATBOT TOGGLE BUTTON
  ============================================ */
.ai-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10001;
}

.ai-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.ai-chatbot-toggle.active {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
}

.ai-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #fff;
}

.ai-chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

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

/* ============================================
  CHATBOT WIDGET
  ============================================ */
.ai-chatbot-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

body.dark-mode .ai-chatbot-widget {
    background: #1a1a2e;
    color: #e0e0e0;
}

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

/* ============================================
  CHATBOT HEADER
  ============================================ */
.ai-chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-chatbot-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

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

.ai-chatbot-btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chatbot-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ============================================
  MESSAGES CONTAINER
  ============================================ */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

body.dark-mode .ai-chatbot-messages {
    background: #0f0f1e;
}

.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.2);
    border-radius: 3px;
}

body.dark-mode .ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
  MESSAGE STYLES
  ============================================ */
.ai-chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    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-ai {
    align-self: flex-start;
}

.ai-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ai-chatbot-message-content {
    background: #fff;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .ai-chatbot-message-content {
    background: #2a2a3e;
    color: #e0e0e0;
}

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

.ai-chatbot-message-text {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-chatbot-message-text a {
    color: #667eea;
    text-decoration: underline;
}

.ai-chatbot-message-user .ai-chatbot-message-text a {
    color: #fff;
    opacity: 0.9;
}

.ai-chatbot-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

/* ============================================
  TYPING INDICATOR
  ============================================ */
.ai-chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

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

.ai-chatbot-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;
    }
}

/* ============================================
  QUICK ACTIONS
  ============================================ */
.ai-chatbot-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

body.dark-mode .ai-chatbot-quick-actions {
    background: #0f0f1e;
    border-top-color: #2a2a3e;
}

.quick-action-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
}

body.dark-mode .quick-action-btn {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

.quick-action-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 10px;
}

/* ============================================
  INPUT CONTAINER
  ============================================ */
.ai-chatbot-input-container {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .ai-chatbot-input-container {
    background: #1a1a2e;
    border-top-color: #2a2a3e;
}

.ai-chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ai-chatbot-input-wrapper textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s ease;
}

body.dark-mode .ai-chatbot-input-wrapper textarea {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

.ai-chatbot-input-wrapper textarea:focus {
    border-color: #667eea;
}

.ai-chatbot-btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-chatbot-btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-chatbot-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: #999;
}

.ai-chatbot-char-count {
    opacity: 0.6;
}

.ai-chatbot-char-count.error {
    color: #ff4444;
}

.ai-chatbot-btn-voice {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: all 0.2s ease;
}

.ai-chatbot-btn-voice:hover {
    color: #764ba2;
    transform: scale(1.1);
}

/* ============================================
  RESPONSIVE DESIGN
  ============================================ */
@media (max-width: 768px) {
    #website-ai-chatbot {
        bottom: 10px;
        right: 10px;
    }

    .ai-chatbot-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        bottom: 70px;
        right: 0;
        border-radius: 20px 20px 0 0;
    }

    .ai-chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

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

    .ai-chatbot-quick-actions {
        padding: 8px 12px;
    }

    .quick-action-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ============================================
  ACCESSIBILITY
  ============================================ */
.ai-chatbot-widget:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.ai-chatbot-btn-send:focus,
.ai-chatbot-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ============================================
  HIGHLIGHT ANIMATION
  ============================================ */
.highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(102, 126, 234, 0.3);
    }
}

