/* Floating Widget Container */
#moviebuddy-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* Keeps it on top of everything */
    pointer-events: none;
}

/* The Chat Bubble Button */
.chat-bubble-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e50914;
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    transition: transform 0.2s;
    float: right;
    pointer-events: auto;
}

.chat-bubble-btn:hover {
    transform: scale(1.1);
}

/* The Chat Window Popup */
.chat-popup {
    width: 350px;
    height: 500px;
    background-color: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
    position: absolute;
    bottom: 80px; 
    right: 0;
    pointer-events: auto;
}

/* Hide class for toggling */
.chat-popup.hidden {
    opacity: 0;
    transform: scale(0.1);
    pointer-events: none;
}

.chat-header {
    padding: 15px;
    background-color: #e50914;
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Reusing our previous chat styles! */
.chat-box {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.user-msg {
    background-color: #2b2b2b;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.bot-msg {
    background-color: #333333;
    color: #f1f1f1;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

/* Mini grid for recommended movies */
.chat-movie-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.chat-movie-grid img {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background-color: #121212;
    border-radius: 0 0 12px 12px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background-color: #2b2b2b;
    color: white;
    outline: none;
}

.chat-input-area button {
    background-color: #e50914;
    color: white;
    border: none;
    padding: 0 15px;
    margin-left: 8px;
    border-radius: 6px;
    cursor: pointer;
}
.chat-bubble-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures it doesn't stretch weirdly */
    border-radius: 50%; /* Makes the image perfectly round to match the button */
    display: block; /* Removes weird spacing under images */
}