/* NotebookLM styled Chatbox - Glassmorphism & Gold Accents */

.notebook-chat-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

.chat-bubble-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f59e0b; /* Brkthru Gold */
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: #0f172a;
}

.chat-bubble-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.5);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

.chat-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-select-container {
    padding: 1rem 1.5rem;
    background: #0f172a; /* Deep Blue */
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.library-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #f59e0b; /* Gold */
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.notebook-select {
    background: #1e293b;
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.notebook-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.sources-bar {
    padding: 0.75rem 1rem;
    background: rgba(241, 245, 249, 0.5);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.sources-bar::-webkit-scrollbar {
    display: none;
}

.source-tag {
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.source-tag.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #0f172a;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.ai {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #1e293b;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message.user {
    background: #0f172a;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #f59e0b;
}

.send-btn {
    background: #0f172a;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #1e293b;
}

/* Animations */
.chat-enter {
    animation: chat-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chat-pop {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 2rem);
        height: calc(100vh - 100px);
        right: -1rem;
        bottom: 70px;
    }
}
