/* Unified Chatbot Styles - ChatGPT-like Interface */
.unified-chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.unified-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chatbot-icon {
    color: white;
    z-index: 2;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    z-index: 3;
}

.chatbot-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 0.5; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Modal Styles */
.unified-chatbot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.unified-chatbot-modal.open {
    opacity: 1;
    visibility: visible;
}

.unified-chatbot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.unified-chatbot-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.unified-chatbot-modal.open .unified-chatbot-container {
    transform: translate(-50%, -50%) scale(1);
}

/* Dark Mode Support */
.dark-mode .unified-chatbot-container {
    background: #1a1a1a;
    color: #e5e5e5;
}

/* Header */
.unified-chatbot-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark-mode .unified-chatbot-header {
    border-bottom-color: #374151;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar-main {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    letter-spacing: -0.01em;
}

.chatbot-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.unified-chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.unified-chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Container */
.unified-chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.unified-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.unified-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.unified-chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dark-mode .unified-chatbot-messages::-webkit-scrollbar-track {
    background: #374151;
}

.dark-mode .unified-chatbot-messages::-webkit-scrollbar-thumb {
    background: #6b7280;
}

/* Messages */
.unified-message {
    display: flex;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    order: 2;
    margin-left: 12px;
}

.bot-avatar {
    background: #f3f4f6;
    color: #6b7280;
    margin-right: 12px;
}

.dark-mode .bot-avatar {
    background: #374151;
    color: #9ca3af;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 48px);
}

.user-message .message-content {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.bot-message .message-text {
    background: #f3f4f6;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
}

.dark-mode .bot-message .message-text {
    background: #374151;
    color: #ffffff !important;
}

.dark-mode .bot-message .message-text * {
    color: #ffffff !important;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-message .typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-text {
    color: #9ca3af;
    font-size: 14px;
    font-style: italic;
}

/* Welcome Content */
.welcome-content {
    padding: 20px 0;
}

.welcome-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1f2937;
}

.dark-mode .welcome-header h2 {
    color: #e5e5e5;
}

.welcome-header p {
    margin: 0 0 20px 0;
    color: #6b7280;
}

.dark-mode .welcome-header p {
    color: #9ca3af;
}

.welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.dark-mode .feature-item {
    background: #2d3748;
    border-color: #4a5568;
}

.feature-icon {
    font-size: 24px;
}

.feature-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.dark-mode .feature-content h4 {
    color: #e5e5e5;
}

.feature-content p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.dark-mode .feature-content p {
    color: #9ca3af;
}

.welcome-actions p {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
}

.dark-mode .welcome-actions p {
    color: #e5e5e5;
}

/* Fallback Content */
.fallback-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1f2937;
}

.dark-mode .fallback-content h3 {
    color: #e5e5e5;
}

.fallback-content p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #4b5563;
}

.dark-mode .fallback-content p {
    color: #9ca3af;
}

.demo-benefits, .help-options {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.dark-mode .demo-benefits,
.dark-mode .help-options {
    background: #2d3748;
}

.demo-benefits h4, .help-options h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.dark-mode .demo-benefits h4,
.dark-mode .help-options h4 {
    color: #e5e5e5;
}

.demo-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.demo-benefits li {
    margin-bottom: 8px;
    color: #4b5563;
}

.dark-mode .demo-benefits li {
    color: #9ca3af;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.help-item:last-child {
    border-bottom: none;
}

.dark-mode .help-item {
    border-bottom-color: #4a5568;
}

.help-icon {
    font-size: 20px;
}

.help-text {
    flex: 1;
}

.help-text strong {
    color: #1f2937;
    display: block;
    margin-bottom: 2px;
}

.dark-mode .help-text strong {
    color: #e5e5e5;
}

.contact-options {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.dark-mode .contact-options {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.contact-options p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #1f2937;
}

.dark-mode .contact-options p {
    color: #e5e5e5;
}

.contact-options strong {
    color: #2563eb;
}

.dark-mode .contact-options strong {
    color: #60a5fa;
}

/* Quick Actions */
.unified-chatbot-actions {
    padding: 0 24px 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.dark-mode .unified-chatbot-actions {
    border-top-color: #374151;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.dark-mode .action-btn {
    background: #374151;
    border-color: #4a5568;
    color: #e5e5e5;
}

.dark-mode .action-btn:hover {
    background: #4a5568;
    border-color: #6b7280;
}

.action-icon {
    font-size: 18px;
}

.action-text {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    letter-spacing: -0.01em;
}

/* Input Area */
.unified-chatbot-input-area {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.dark-mode .unified-chatbot-input-area {
    border-top-color: #374151;
    background: #1f2937;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 4px;
    transition: border-color 0.2s ease;
}

.input-container:focus-within {
    border-color: #667eea;
}

.dark-mode .input-container {
    background: #374151;
    border-color: #4a5568;
}

.dark-mode .input-container:focus-within {
    border-color: #8b5cf6;
}

#unified-chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    background: transparent;
    color: #1f2937;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.dark-mode #unified-chatbot-input {
    color: #e5e5e5;
}

#unified-chatbot-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.unified-chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.unified-chatbot-send-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
}

.unified-chatbot-send-btn.active:hover {
    transform: scale(1.05);
}

.input-footer {
    margin-top: 8px;
    text-align: center;
}

.input-hint {
    font-size: 12px;
    color: #9ca3af;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Error Messages */
.error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.dark-mode .error-message {
    background: #7f1d1d;
    border-color: #991b1b;
}

.error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.error-content h4 {
    margin: 0 0 8px 0;
    color: #dc2626;
    font-size: 16px;
    font-weight: 600;
}

.dark-mode .error-content h4 {
    color: #fca5a5;
}

.error-content p {
    margin: 4px 0;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.5;
}

.dark-mode .error-content p {
    color: #fca5a5;
}

.error-hint {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .unified-chatbot-container {
        width: 95%;
        height: 95vh;
        max-height: none;
    }

    .unified-chatbot-header {
        padding: 16px 20px;
    }

    .unified-chatbot-messages {
        padding: 20px;
    }

    .unified-chatbot-actions {
        padding: 0 20px 12px 20px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .unified-chatbot-input-area {
        padding: 12px 20px 20px 20px;
    }

    .welcome-features {
        grid-template-columns: 1fr;
    }
}

/* Animation for modal entrance */
.unified-chatbot-modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   DARK MODE - ENHANCED VISIBILITY
   ========================================== */

/* Make ALL text white and bold in dark mode for better readability */
.dark-mode .unified-chatbot-container,
.dark-mode .unified-chatbot-container * {
    color: #ffffff !important;
}

.dark-mode .welcome-header h2,
.dark-mode .welcome-actions p,
.dark-mode .feature-content h4,
.dark-mode .action-text {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.dark-mode .welcome-header p,
.dark-mode .feature-content p {
    color: #f0f0f0 !important;
    opacity: 1 !important;
}

.dark-mode .bot-message .message-text,
.dark-mode .bot-message .message-text * {
    color: #ffffff !important;
}

.dark-mode .action-btn,
.dark-mode .action-btn * {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Ensure links are visible */
.dark-mode a {
    color: #a5b4ff !important;
}

.dark-mode .unified-chatbot-header,
.dark-mode .unified-chatbot-header * {
    color: #ffffff !important;
}
