body {
    margin: 0;
    background: linear-gradient(135deg, #f2f2f2, #c8d6e5);
    font-family: "Poppins", sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
}

.main-content {
    text-align: center;
    max-width: 500px;
    padding: 20px;
}

.book-cover {
    width: 250px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.book-title {
    font-size: 2rem;
    margin-top: 0px;
}

.book-subtitle {
    color: #555;
    font-size: 1rem;
}

/* Floating chat button */
.chat-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #5563DE;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: background 0.3s ease, transform 0.2s ease;
}

.chat-toggle:hover {
    background-color: #2D3E89;
    transform: scale(1.05);
}

/* Chat popup box */
.chat-popup {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    max-height: 550px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.hidden {
    display: none;
}

.chat-header {
    background: #2D3E89;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.1em;
}

#close-chat {
    cursor: pointer;
    font-size: 1.2em;
}

.chat-box {
    flex-grow: 1;
    padding: 12px;
    overflow-y: auto;
    background-color: #f9f9ff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 16px;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user .bubble {
    background: #5563DE;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.bot .bubble {
    background: #ECEFFD;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.input-area {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #ddd;
}

#user-input {
    flex-grow: 1;
    border: none;
    background: #f1f2f6;
    padding: 10px 14px;
    border-radius: 30px;
    font-size: 15px;
    outline: none;
}

#send-btn {
    border: none;
    background: #5563DE;
    color: white;
    font-size: 18px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#send-btn:hover {
    background: #2D3E89;
}

.typing {
    font-style: italic;
    color: #999;
    margin: 5px 0;
}

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