/* AI Demo Bot - Frontend Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.ai-demo-bot-container {
    --ai-primary-color: #000000;
    --ai-bg: #ffffff;
    --ai-bg-secondary: #f9fafb;
    --ai-border: #e5e7eb;
    --ai-text: #111827;
    --ai-text-secondary: #6b7280;
    --ai-success: #10b981;
    --ai-warning: #f59e0b;
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 500px;
    margin: 0 auto;
}

.ai-demo-bot-chat {
    background: var(--ai-bg);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Header */
.ai-demo-bot-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: var(--ai-primary-color);
    color: white;
}

.ai-demo-bot-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-demo-bot-avatar svg {
    width: 26px;
    height: 26px;
}

.ai-demo-bot-info {
    flex: 1;
    min-width: 0;
}

.ai-demo-bot-info h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #ffffff !important;
}

.ai-demo-bot-info span {
    font-size: 13px;
    opacity: 0.8;
}

.ai-demo-bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Messages */
.ai-demo-bot-messages {
    height: 380px;
    overflow-y: auto;
    padding: 24px;
    background: var(--ai-bg-secondary);
}

.ai-demo-bot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-demo-bot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-demo-bot-messages::-webkit-scrollbar-thumb {
    background: var(--ai-border);
    border-radius: 3px;
}

/* Welcome Message */
.ai-demo-bot-welcome {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--ai-primary-color) 0%, #374151 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.welcome-icon svg {
    width: 32px;
    height: 32px;
}

.ai-demo-bot-welcome p {
    margin: 0;
    color: var(--ai-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.ai-demo-bot-welcome strong {
    color: var(--ai-text);
}

/* Message Bubbles */
.ai-demo-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.ai-demo-message-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-demo-message.user .ai-demo-message-bubble {
    background: var(--ai-primary-color);
    color: white;
    border-bottom-right-radius: 6px;
}

.ai-demo-message.ai .ai-demo-message-bubble {
    background: var(--ai-bg);
    color: var(--ai-text);
    border: 1px solid var(--ai-border);
    border-bottom-left-radius: 6px;
}

/* Data Status Badge */
.ai-demo-data-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.ai-demo-data-status.found {
    background: #dcfce7;
    color: #166534;
}

.ai-demo-data-status.gap {
    background: #fef3c7;
    color: #92400e;
}

.ai-demo-data-status svg {
    width: 12px;
    height: 12px;
}

/* Typing Indicator */
.ai-demo-typing {
    display: flex;
    gap: 5px;
    padding: 8px 0;
}

.ai-demo-typing span {
    width: 8px;
    height: 8px;
    background: var(--ai-text-secondary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.ai-demo-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-demo-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Questions */
.ai-demo-bot-quick {
    padding: 16px 24px;
    background: var(--ai-bg);
    border-top: 1px solid var(--ai-border);
}

.ai-demo-bot-quick > span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ai-text-secondary);
    margin-bottom: 10px;
}

.ai-demo-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    padding: 8px 14px;
    background: var(--ai-primary-color);
    border: 1px solid var(--ai-primary-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: transparent;
    color: var(--ai-primary-color);
    border-color: var(--ai-primary-color);
    transform: translateY(-1px);
}

/* Input */
.ai-demo-bot-input {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: var(--ai-bg);
    border-top: 1px solid var(--ai-border);
}

.ai-demo-bot-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--ai-border);
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--ai-bg);
}

.ai-demo-bot-input input:focus {
    outline: none;
    border-color: var(--ai-primary-color);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.ai-demo-bot-input input::placeholder {
    color: var(--ai-text-secondary);
}

.ai-demo-bot-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-demo-bot-input button:active {
    transform: scale(0.98);
}

.ai-demo-bot-input button .send-icon {
    font-size: 20px;
    color: #ffffff;
    display: block;
    line-height: 1;
}

.ai-demo-bot-input button {
    width: 50px;
    height: 50px;
    background: var(--ai-primary-color);
    border: none;
    border-radius: 14px;
    color: #ffffff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Footer */
.ai-demo-bot-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.ai-demo-bot-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
}

.ai-demo-bot-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 540px) {
    .ai-demo-bot-container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .ai-demo-bot-chat {
        border-radius: 20px;
    }
    
    .ai-demo-bot-messages {
        height: 320px;
    }
}

/* ===== BEFORE/AFTER TOGGLE ===== */
.ai-demo-toggle-row {
    display: flex;
    justify-content: center;
    padding: 0 24px 16px 24px;
    background: var(--ai-primary-color);
}

.ai-demo-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px;
    position: relative;
}

/* Sliding white pill background */
.ai-demo-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 50px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.ai-demo-toggle.mode-after::before {
    transform: translateX(100%);
}

.ai-demo-toggle-btn {
    padding: 10px 24px;
    border: none !important;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}

.ai-demo-toggle-btn:focus,
.ai-demo-toggle-btn:active,
.ai-demo-toggle-btn:focus-visible,
.ai-demo-toggle-btn:hover,
.ai-demo-toggle-btn:focus-within {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.ai-demo-toggle button,
.ai-demo-toggle button:focus,
.ai-demo-toggle button:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.ai-demo-toggle-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.ai-demo-toggle-btn.active {
    color: #000;
    background: transparent !important;
}

/* Mode Banner */
.ai-demo-mode-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 500;
}

.ai-demo-mode-banner.mode-before {
    background: #fef2f2;
    color: #dc2626;
}

.ai-demo-mode-banner.mode-after {
    background: #f0fdf4;
    color: #16a34a;
}

/* No Data Badge */
.ai-demo-data-status.no-data {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 540px) {
    .ai-demo-toggle-row {
        padding: 0 16px 12px 16px;
    }
    
    .ai-demo-toggle-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .ai-demo-mode-banner {
        padding: 6px 12px;
        font-size: 10px;
    }
}
