/* === AI Context Feature === */
.bc-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 9999px;
    color: #38bdf8;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.25s;
}

.bc-ai-btn:hover {
    background-color: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
}

.bc-ai-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bc-ai-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.bc-ai-response {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: 0.5rem;
}

.bc-ai-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4a5568;
    font-size: 0.875rem;
}

.bc-ai-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: bc-spin 0.8s linear infinite;
}

@keyframes bc-spin {
    to { transform: rotate(360deg); }
}

.bc-ai-error {
    color: #f87171;
    font-size: 0.875rem;
    line-height: 1.5;
}

.bc-ai-retry {
    color: #38bdf8 !important;
    text-decoration: underline !important;
    cursor: pointer;
    font-weight: 500;
}

.bc-ai-retry:hover {
    color: #7dd3fc !important;
}

.bc-ai-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bc-ai-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(136, 146, 164, 0.1);
}

.bc-ai-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.bc-ai-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #38bdf8;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.bc-ai-section-text {
    font-size: 0.875rem;
    color: #8892a4;
    line-height: 1.625;
    margin: 0;
}

/* === Ask AI Chat Feature === */
.bc-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 9999px;
    color: #38bdf8;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.25s;
}

.bc-chat-btn:hover {
    background-color: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
}

/* Overlay */
.bc-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(11, 18, 33, 0.8);
    backdrop-filter: blur(4px);
}

/* Modal */
.bc-chat-modal {
    width: 100%;
    max-width: 640px;
    height: 80vh;
    max-height: 700px;
    background-color: #0f1729;
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
.bc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(136, 146, 164, 0.1);
}

.bc-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bc-chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.bc-chat-header-title {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

.bc-chat-header-status {
    color: #4a5568;
    font-size: 0.75rem;
    margin: 0.125rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bc-chat-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #22c55e;
    animation: bc-pulse 2s infinite;
}

@keyframes bc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.bc-chat-close {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
}

.bc-chat-close:hover {
    color: #e2e8f0;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Messages area */
.bc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty state */
.bc-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 1.5rem;
}

.bc-chat-empty-icon {
    width: 3rem;
    height: 3rem;
    color: #38bdf8;
    margin-bottom: 1rem;
}

.bc-chat-empty-title {
    color: #e2e8f0;
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
}

.bc-chat-empty-desc {
    color: #4a5568;
    font-size: 0.875rem;
    margin: 0 0 1.5rem;
    max-width: 24rem;
    line-height: 1.5;
}

.bc-chat-suggested {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 24rem;
}

.bc-chat-suggested-btn {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background-color: rgba(30, 41, 59, 0.6);
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: #8892a4;
    font-size: 0.8125rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.bc-chat-suggested-btn:hover {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: rgba(56, 189, 248, 0.2);
    color: #e2e8f0;
}

/* Message bubbles */
.bc-chat-msg {
    display: flex;
}

.bc-chat-msg-user {
    justify-content: flex-end;
}

.bc-chat-msg-user .bc-chat-msg-bubble {
    background-color: #38bdf8;
    color: #0b1221;
    border-radius: 1rem 1rem 0.25rem 1rem;
    max-width: 80%;
}

.bc-chat-msg-assistant .bc-chat-msg-bubble {
    background-color: rgba(30, 41, 59, 0.6);
    color: #8892a4;
    border-radius: 1rem 1rem 1rem 0.25rem;
    max-width: 85%;
}

.bc-chat-msg-error .bc-chat-msg-bubble {
    background-color: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-radius: 1rem;
    max-width: 85%;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.bc-chat-msg-bubble {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.625;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Input bar */
.bc-chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(136, 146, 164, 0.1);
}

.bc-chat-input {
    flex: 1;
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(136, 146, 164, 0.15);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.bc-chat-input::placeholder {
    color: #4a5568;
}

.bc-chat-input:focus {
    border-color: rgba(56, 189, 248, 0.4);
}

.bc-chat-send {
    background-color: #38bdf8;
    border: none;
    border-radius: 0.75rem;
    padding: 0.625rem;
    color: #0b1221;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.bc-chat-send:hover {
    opacity: 0.85;
}

/* Mobile adjustments */
@media (max-width: 991px) {
    .bc-chat-modal {
        height: 90vh;
        max-height: none;
        border-radius: 0.75rem;
    }
}

@media (max-width: 575px) {
    .bc-chat-overlay {
        padding: 0;
    }

    .bc-chat-modal {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}
