/* ============================================
   AI CHAT WIDGET — Black Cat Artist Studio
   ============================================ */

#bc-chat-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Manrope', system-ui, sans-serif;
}

/* ============================================
   FLOATING TOGGLE BUTTON
   ============================================ */

.bc-chat-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00E5FF 0%, #FF6B35 100%);
    color: #050505;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(0, 229, 255, 0.35),
        0 4px 16px rgba(255, 107, 53, 0.25);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s ease;
    overflow: visible;
}

.bc-chat-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 12px 40px rgba(0, 229, 255, 0.5),
        0 6px 20px rgba(255, 107, 53, 0.35);
}

.bc-chat-toggle:active {
    transform: translateY(0) scale(0.98);
}

.bc-chat-icon-close {
    display: none;
}

.bc-chat-open .bc-chat-icon-open {
    display: none;
}

.bc-chat-open .bc-chat-icon-close {
    display: block;
}

/* Badge */
.bc-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #050505;
    animation: bc-badge-pulse 2s ease-in-out infinite;
}

@keyframes bc-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* ============================================
   CHAT PANEL
   ============================================ */

.bc-chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow:
        0 24px 80px -20px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 120px -30px rgba(0, 229, 255, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bc-slide-up 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes bc-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   HEADER
   ============================================ */

.bc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bc-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-chat-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(255, 107, 53, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00E5FF;
}

.bc-chat-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(0, 229, 255, 0.5);
    animation: bc-pulse 2s ease-in-out infinite;
}

@keyframes bc-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.15); opacity: 0; }
}

.bc-chat-title {
    font-family: 'Sora', system-ui, sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #FAFAF7;
    margin: 0 0 2px 0;
    letter-spacing: -0.01em;
}

.bc-chat-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bc-chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 8px #22C55E;
    animation: bc-dot-pulse 2s ease-in-out infinite;
}

@keyframes bc-dot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.bc-chat-minimize {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bc-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FAFAF7;
}

/* ============================================
   MESSAGES
   ============================================ */

.bc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.bc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.bc-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.bc-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.bc-chat-msg {
    display: flex;
    animation: bc-msg-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes bc-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bc-chat-msg-bot {
    justify-content: flex-start;
}

.bc-chat-msg-user {
    justify-content: flex-end;
}

.bc-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bc-chat-msg-bot .bc-chat-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bc-chat-msg-user .bc-chat-bubble {
    background: linear-gradient(135deg, #00E5FF 0%, #00C4DB 100%);
    color: #050505;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}

/* Typing indicator */
.bc-chat-typing {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}

.bc-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: bc-typing 1.4s ease-in-out infinite;
}

.bc-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.bc-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bc-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}

/* ============================================
   QUICK SUGGESTIONS
   ============================================ */

.bc-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.bc-chat-suggestion {
    padding: 8px 14px;
    border-radius: 100px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: #00E5FF;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.bc-chat-suggestion:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.4);
    transform: translateY(-1px);
}

/* ============================================
   INPUT FORM
   ============================================ */

.bc-chat-form {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bc-chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #FAFAF7;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.bc-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.bc-chat-input:focus {
    border-color: #00E5FF;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.bc-chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bc-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00E5FF 0%, #FF6B35 100%);
    color: #050505;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bc-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.4);
}

.bc-chat-send:active:not(:disabled) {
    transform: scale(0.98);
}

.bc-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */

.bc-chat-footer {
    text-align: center;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.25);
    padding: 8px 20px 12px;
    margin: 0;
    letter-spacing: 0.05em;
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 480px) {
    #bc-chat-root {
        bottom: 16px;
        right: 16px;
    }

    .bc-chat-toggle {
        width: 54px;
        height: 54px;
    }

    .bc-chat-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 72px;
        right: -8px;
        border-radius: 20px;
    }

    .bc-chat-bubble {
        max-width: 85%;
        font-size: 13px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bc-chat-toggle,
    .bc-chat-panel,
    .bc-chat-msg,
    .bc-chat-badge,
    .bc-chat-pulse,
    .bc-chat-typing span {
        animation: none !important;
        transition: none !important;
    }
}