/* AI Assistant Support Widget */
#ai-assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Floating Button */
#ai-assistant-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid #3d3d3d;
    position: relative;
    overflow: hidden;
}

#ai-assistant-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    border-color: #4d4d4d;
}

#ai-assistant-button:active {
    transform: translateY(0);
}

#ai-assistant-button.active {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #4d4d4d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.ai-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 8px;
}

.ai-label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Chat Popup */
.ai-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.3s ease;
}

.ai-popup.hidden {
    display: none;
}

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

/* Popup Header */
.ai-popup-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #3d3d3d;
}

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

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

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

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

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

.ai-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Popup Body */
.ai-popup-body {
    display: flex;
    flex-direction: column;
    height: 400px;
}

/* Chat Views */
.ai-chat-view,
.tawk-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tawk-chat-view.hidden,
.ai-chat-view.hidden {
    display: none;
}

/* Tawk.to Container */
.tawk-chat-container {
    flex: 1;
    background: #2d2d2d;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

/* Back Button */
.ai-back-btn {
    background: #3d3d3d;
    color: white;
    border: 1px solid #4d4d4d;
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 0 0 16px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-back-btn:hover {
    background: #4d4d4d;
}

/* Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ai-message {
    display: flex;
    margin-bottom: 16px;
}

.ai-message.ai-bot {
    justify-content: flex-start;
}

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

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.ai-message.ai-bot .ai-message-content {
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    color: white;
    border-bottom-left-radius: 4px;
}

.ai-message.ai-user .ai-message-content {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    color: white;
    border-bottom-right-radius: 4px;
    border: 1px solid #4d4d4d;
}

.ai-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.ai-message.ai-bot .ai-message-time {
    color: #666;
}

.ai-message.ai-user .ai-message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Quick Actions */
.ai-quick-actions {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-quick-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.ai-quick-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Chat Input */
.ai-chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

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

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    border-color: #4d4d4d;
    background: #2d2d2d;
}

.ai-chat-input::placeholder {
    color: #999;
}

.ai-send-btn {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    border: 2px solid #4d4d4d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    border-color: #5d5d5d;
    background: linear-gradient(135deg, #3d3d3d 0%, #4d4d4d 100%);
}

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

/* Scrollbar Styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive */
@media (max-width: 480px) {
    #ai-assistant-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .ai-popup {
        width: 320px;
        right: -20px;
    }
    
    .ai-popup-body {
        height: 350px;
    }
    
.ai-quick-actions {
flex-wrap: wrap;
}
    
.ai-quick-btn {
flex: 1 1 calc(50% - 4px);
min-width: 120px;
}
}

/* Pulse Animation for Button */
@keyframes pulse {
0%, 100% {
box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}
50% {
box-shadow: 0 4px 30px rgba(76, 175, 80, 0.6);
}
}

#ai-assistant-button:not(.active) {
animation: pulse 2s infinite;
}

/* Tawk.to Custom Styling - Dark Theme */
/* Completely hide default Tawk.to button */
iframe[title*="chat widget"] {
opacity: 0 !important;
pointer-events: none !important;
visibility: hidden !important;
}

/* Override Tawk.to colors with dark theme when shown */
body .tawk-messenger-container {
    --tawk-header-bg-color: #1a1a1a !important;
    --tawk-header-text-color: #ffffff !important;
    --tawk-bg-color: #2d2d2d !important;
    --tawk-text-color: #ffffff !important;
    --tawk-agent-bg-color: #3d3d3d !important;
    --tawk-agent-text-color: #ffffff !important;
    --tawk-visitor-bg-color: #4d4d4d !important;
    --tawk-visitor-text-color: #ffffff !important;
}

/* Tawk.to dark theme overrides */
#tawk-chat-container {
    background: #2d2d2d !important;
}

.tawk-chat-panel {
    background: #2d2d2d !important;
}

.tawk-chat-header {
    background: #1a1a1a !important;
}

.tawk-chat-message {
    background: #3d3d3d !important;
    color: #ffffff !important;
}

.tawk-chat-message.tawk-agent-message {
    background: #4d4d4d !important;
    color: #ffffff !important;
}
