/* AI Chat Widget Styles - Standalone (No Build Required) */

.ai-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle-button {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chat-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-toggle-button .chat-icon,
.chat-toggle-button .close-icon {
    transition: opacity 0.2s ease;
}

.chat-toggle-button .hidden {
    display: none;
}

/* Unread Badge */
.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.unread-badge.hidden {
    display: none;
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.chat-panel.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.9);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.chat-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.chat-close-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
}

.welcome-logo {
    margin-bottom: 16px;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.welcome-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.welcome-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    text-align: left;
}

.welcome-list li {
    padding: 8px 0;
    font-size: 14px;
    color: #374151;
}

.welcome-footer {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
    margin: 0;
}

/* Message Bubbles */
.message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #10b981;
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.assistant .message-bubble {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.message.user .message-bubble {
    background: #667eea;
    color: white;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Auth Prompt */
.auth-prompt {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    padding: 16px;
    margin: 16px;
    border-radius: 8px;
    text-align: center;
}

.auth-prompt.hidden {
    display: none;
}

.auth-button {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 8px;
    transition: background 0.2s;
}

.auth-button:hover {
    background: #5568d3;
}

/* Input Container */
.chat-input-container {
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 16px;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    color: #1f2937;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-send-button {
    background: #667eea;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
    background: #5568d3;
}

.chat-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-disclaimer {
    font-size: 11px;
    color: #9ca3af;
    margin: 8px 0 0 0;
    text-align: center;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 20px;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}
