/**
 * Browser LLM Chat Widget Styles
 * Floating AI assistant widget
 */

/* Modal Styles - Namespaced to avoid conflicts */
.chat-widget-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget-modal .modal-dialog {
    max-width: 600px;
    width: 90%;
    margin: 1.75rem auto;
}

.chat-widget-modal .modal-content {
    border-radius: 12px;
    border: 1px solid #30363d;
}

.chat-widget-modal .modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #30363d;
}

.chat-widget-modal .modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.chat-widget-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #30363d;
}

/* Model Options */
.model-option {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #30363d;
    border-radius: 8px;
    transition: all 0.2s;
}

.model-option:hover {
    background: #161b22;
    border-color: #667eea;
}

.model-option input[type="radio"]:checked + label {
    color: #667eea;
}

.model-option .form-check {
    margin-bottom: 0;
}

.model-option .form-check-label {
    cursor: pointer;
    padding: 0.25rem 0;
}

/* Chat Widget Button (Floating) */
.chat-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    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 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.chat-widget-button i {
    font-size: 28px;
    color: white;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Widget Window */
.chat-widget-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #1a1d29;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

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

.chat-widget-header strong {
    font-size: 16px;
}

.chat-widget-header .text-muted {
    font-size: 12px;
    opacity: 0.9;
}

/* Chat Messages Area */
.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #0d1117;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.chat-message.user {
    align-items: flex-end;
}

.chat-message.assistant {
    align-items: flex-start;
}

.chat-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-message.user .chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-message.assistant .chat-message-content {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

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

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #8b949e;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input Area */
.chat-widget-input {
    padding: 16px;
    background: #161b22;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #30363d;
}

.chat-widget-input textarea {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    resize: none;
}

.chat-widget-input textarea:focus {
    background: #161b22;
    border-color: #667eea;
    color: #c9d1d9;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.chat-widget-input button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.chat-widget-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 80px);
        right: 12px;
        bottom: 12px;
    }

    .chat-widget-button {
        bottom: 16px;
        right: 16px;
    }
}

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

.chat-widget-messages::-webkit-scrollbar-track {
    background: #0d1117;
}

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

.chat-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}
