/**
 * AI Chat CSS - Enhanced styling for AI-integrated chat system
 * Provides modern, accessible design for AI assistant interactions
 */

/* AI Channel Styling */
.ai-channel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-left: 4px solid #4f46e5;
}

.ai-channel:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.collective-channel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #059669;
}

.collective-channel:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* AI Chat Window Headers */
.ai-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collective-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* AI Status Indicator */
.ai-status {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-online {
    background: rgba(34, 197, 94, 0.8);
    color: white;
    animation: pulse-online 2s infinite;
}

.status-thinking {
    background: rgba(251, 191, 36, 0.8);
    color: white;
    animation: pulse-thinking 1s infinite;
}

.status-error {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    animation: pulse-error 0.5s infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-thinking {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes pulse-error {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* AI Message Styling */
.c_ai {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-left: 4px solid #4f46e5;
    border-radius: 8px;
    margin: 8px 0;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.c_ai .chatFrom {
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.9em;
}

.c_ai_warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin: 8px 0;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.c_ai_warning .chatFrom {
    color: #d97706;
    font-weight: 600;
}

.c_ai_error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    margin: 8px 0;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.c_ai_error .chatFrom {
    color: #dc2626;
    font-weight: 600;
}

.c_ai_thinking {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-left: 4px solid #9ca3af;
    border-radius: 8px;
    margin: 8px 0;
    padding: 12px;
    animation: thinking-pulse 1.5s infinite;
    font-style: italic;
    opacity: 0.8;
}

@keyframes thinking-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Enhanced Chat Input for AI */
.ai-channel .chatSendField {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.ai-channel .chatSendField:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
    outline: none;
}

.ai-channel .chatSendField::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* AI Send Button */
.ai-send-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
}

.ai-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.ai-send-btn:active {
    transform: translateY(0);
}

.ai-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Chat Container for AI */
.ai-channel .divChatWindow {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: white;
}

.collective-channel .divChatWindow {
    border: 2px solid #d1fae5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Channel List Enhancements */
.liChatChannel {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: white;
    border: 1px solid transparent;
}

.liChatChannel:hover:not(.liDisabled) {
    transform: translateX(4px);
}

.liChatChannel.liSelected {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.liChatChannel.liDisabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}

/* Chat Content Enhancements */
.chat_content {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
}

.chat_content li {
    list-style: none;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.c_you {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
    margin-left: 20px;
}

.c_oth {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-left: 4px solid #6b7280;
    margin-right: 20px;
}

.chatFrom {
    font-weight: 600;
    color: #374151;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .divChatWindow {
        width: 100%;
        margin: 0;
    }
    
    .chatSendField {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .ai-send-btn {
        padding: 10px 16px;
        font-size: 0.8em;
    }
    
    .ai-status {
        font-size: 0.7em;
        padding: 3px 6px;
    }
}

/* Accessibility Enhancements */
.ai-channel:focus-within,
.collective-channel:focus-within {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.chatSendField:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ai-channel {
        background: #000080;
        border-color: #ffffff;
    }
    
    .collective-channel {
        background: #006400;
        border-color: #ffffff;
    }
    
    .c_ai {
        background: #f0f0f0;
        border-color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .liChatChannel,
    .ai-send-btn,
    .chatSendField {
        transition: none;
    }
    
    .status-online,
    .status-thinking,
    .status-error,
    .c_ai_thinking {
        animation: none;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .chat_content {
        background: #1f2937;
    }
    
    .chat_content li {
        background: #374151;
        color: #f9fafb;
    }
    
    .ai-channel .chatSendField {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .c_ai {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        color: #f1f5f9;
    }
} 