/* 709IT AI Chat Widget Styles */

:root {
    --ai709-primary: #0073aa;
    --ai709-primary-dark: #005177;
    --ai709-bg: #ffffff;
    --ai709-text: #2c3e50;
    --ai709-text-light: #7f8c8d;
    --ai709-border: #e1e8ed;
    --ai709-shadow: 0 5px 40px rgba(0,0,0,0.16);
    --ai709-radius: 12px;
}

/* Main Widget Container */
#ai709-chat-widget {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#ai709-chat-window{
    height: 750% !important;    
}

.ai709-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai709-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.ai709-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai709-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.ai709-chat-btn:hover {
    background: var(--ai709-primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.ai709-chat-btn svg {
    width: 28px;
    height: 28px;
}

.ai709-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.ai709-chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--ai709-bg);
    border-radius: var(--ai709-radius);
    box-shadow: var(--ai709-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ai709-slide-up 0.3s ease;
}

.ai709-widget-bottom-right .ai709-chat-window {
    right: 0;
}

.ai709-widget-bottom-left .ai709-chat-window {
    left: 0;
}

@keyframes ai709-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ai709-chat-header {
    background: var(--ai709-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai709-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai709-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai709-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai709-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.ai709-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    animation: ai709-pulse 2s infinite;
}

@keyframes ai709-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai709-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.ai709-close-btn:hover {
    opacity: 0.8;
}

/* Messages Area */
.ai709-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.ai709-message {
    margin-bottom: 16px;
    display: flex;
    animation: ai709-fade-in 0.3s ease;
}

@keyframes ai709-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai709-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.ai709-message-bot .ai709-message-content {
    background: white;
    color: var(--ai709-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ai709-message-user {
    justify-content: flex-end;
}

.ai709-message-user .ai709-message-content {
    background: var(--ai709-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai709-message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.ai709-message-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

/* Typing Indicator */
.ai709-typing {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-top: 1px solid var(--ai709-border);
}

.ai709-typing-indicator {
    display: flex;
    gap: 4px;
}

.ai709-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai709-text-light);
    animation: ai709-typing-bounce 1.4s infinite;
}

.ai709-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai709-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai709-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

.ai709-typing-text {
    font-size: 13px;
    color: var(--ai709-text-light);
}

/* Input Area */
.ai709-input-area {
    border-top: 1px solid var(--ai709-border);
    background: white;
}

.ai709-image-preview {
    padding: 12px 20px;
    border-bottom: 1px solid var(--ai709-border);
    position: relative;
}

.ai709-image-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    object-fit: cover;
}

.ai709-remove-image {
    position: absolute;
    top: 8px;
    right: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.ai709-input-wrapper {
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 8px;
}

.ai709-attach-btn {
    background: transparent;
    border: none;
    color: var(--ai709-text-light);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.ai709-attach-btn:hover {
    color: var(--ai709-primary);
}

#ai709-user-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 0;
    max-height: 100px;
    overflow-y: auto;
}

#ai709-user-input::placeholder {
    color: var(--ai709-text-light);
}

.ai709-send-btn {
    background: var(--ai709-primary);
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.ai709-send-btn:hover {
    background: var(--ai709-primary-dark);
}

.ai709-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.ai709-footer {
    padding: 8px 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid var(--ai709-border);
}

.ai709-footer small {
    color: var(--ai709-text-light);
    font-size: 11px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    /* Fix main container */
    #ai709-chat-widget {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
    }
    
    /* Override position classes */
    .ai709-widget-bottom-right,
    .ai709-widget-bottom-left {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
    }
    
    /* Fix chat window - center it horizontally */
    .ai709-chat-window {
        position: fixed !important;
        bottom: 80px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        max-height: calc(100vh - 100px) !important;
        margin: 0 auto !important;
    }
    
    /* Override all position variants */
    .ai709-widget-bottom-right .ai709-chat-window,
    .ai709-widget-bottom-left .ai709-chat-window {
        left: 10px !important;
        right: 10px !important;
    }
    
    /* Smaller chat button on mobile */
    .ai709-chat-btn {
        width: 56px;
        height: 56px;
    }
    
    .ai709-chat-btn svg {
        width: 24px;
        height: 24px;
    }
    
    /* Adjust header for mobile */
    .ai709-chat-header {
        padding: 12px 16px;
    }
    
    .ai709-header-text h3 {
        font-size: 15px;
    }
    
    .ai709-status {
        font-size: 12px;
    }
    
    /* Adjust message area */
    .ai709-messages {
        padding: 12px;
    }
    
    .ai709-message-content {
        max-width: 85%;
        font-size: 14px;
    }
    
    /* Adjust input area */
    .ai709-input-wrapper {
        padding: 10px 12px;
    }
}

/* Scrollbar Styling */
.ai709-messages::-webkit-scrollbar {
    width: 6px;
}

.ai709-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai709-messages::-webkit-scrollbar-thumb {
    background: var(--ai709-border);
    border-radius: 3px;
}

.ai709-messages::-webkit-scrollbar-thumb:hover {
    background: var(--ai709-text-light);
}
