/* ===================================
   BRRRBOT AI Chatbot Widget Styles
   =================================== */

/* MTI Refresh FAB Button */
.mti-refresh-fab {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 9998;
}

.mti-refresh-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6);
}

.mti-refresh-fab:active {
    transform: scale(0.95);
}

.mti-refresh-fab.refreshing svg {
    animation: spin-refresh 1s linear infinite;
}

.mti-refresh-fab.success {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

@keyframes spin-refresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Widget Container */
.brrrbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Action Button (Minimized State) */
.brrrbot-fab {
    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 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brrrbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.brrrbot-fab:active {
    transform: scale(0.95);
}

.brrrbot-fab-icon {
    transition: transform 0.3s ease;
}

.brrrbot-widget:not(.brrrbot-minimized) .brrrbot-fab {
    display: none;
}

/* Unread Badge */
.brrrbot-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
    animation: pulse-badge 2s infinite;
}

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

/* Chat Window (Expanded State) */
.brrrbot-window {
    display: none;
    flex-direction: column;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brrrbot-widget:not(.brrrbot-minimized) .brrrbot-window {
    display: flex;
}

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

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

.brrrbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brrrbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brrrbot-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brrrbot-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.brrrbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

.brrrbot-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.brrrbot-header-actions {
    display: flex;
    gap: 8px;
}

.brrrbot-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.brrrbot-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.brrrbot-header-btn:active {
    transform: scale(0.9);
}

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

.brrrbot-messages::-webkit-scrollbar {
    width: 6px;
}

.brrrbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.brrrbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message */
.brrrbot-message {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeInMessage 0.3s ease;
}

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

.brrrbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brrrbot-message-user .brrrbot-message-avatar {
    background: #6b7280;
}

.brrrbot-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brrrbot-message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 85%;
}

.brrrbot-message-user .brrrbot-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.brrrbot-message-bubble p {
    margin: 0 0 8px 0;
    line-height: 1.5;
    font-size: 14px;
}

.brrrbot-message-bubble p:last-child {
    margin-bottom: 0;
}

.brrrbot-message-bubble ul {
    margin: 8px 0;
    padding-left: 20px;
}

.brrrbot-message-bubble li {
    margin: 4px 0;
    font-size: 14px;
}

.brrrbot-message-bubble strong {
    font-weight: 600;
}

.brrrbot-message-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.brrrbot-message-user .brrrbot-message-bubble code {
    background: rgba(255, 255, 255, 0.2);
}

.brrrbot-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 4px;
}

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

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

/* Typing Indicator */
.brrrbot-typing {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.brrrbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

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

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

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

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

.brrrbot-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.brrrbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

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

.brrrbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.brrrbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.brrrbot-send-btn:active {
    transform: scale(0.95);
}

.brrrbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Suggestion Chips */
.brrrbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brrrbot-suggestion-chip {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.brrrbot-suggestion-chip:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.brrrbot-suggestion-chip:active {
    transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brrrbot-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .brrrbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
    
    .brrrbot-fab {
        width: 56px;
        height: 56px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .brrrbot-window {
        background: #1f2937;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    }
    
    .brrrbot-messages {
        background: #111827;
    }
    
    .brrrbot-message-bubble {
        background: #374151;
        color: #f9fafb;
    }
    
    .brrrbot-typing-indicator {
        background: #374151;
    }
    
    .brrrbot-input-container {
        background: #1f2937;
        border-top-color: #374151;
    }
    
    .brrrbot-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .brrrbot-suggestion-chip {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .brrrbot-suggestion-chip:hover {
        background: #4b5563;
    }
}
