body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#chat-container {
    width: 100%;
    max-width: 600px;
    height: 360px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.cards-container {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
}

.card {
    background-color: #fff;
    border: 1px solid #A62B0C;
    border-radius: 15px;
    padding: 10px;
    margin: 5px;
    cursor: pointer;
    text-align: center;
    width: 100px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    font-size: 12px;
}

.card:hover {
    background-color: #f0f0f0;
}

#chat-input-area {
    display: flex;
    padding: 10px;
    background-color: #fff;
    align-items: stretch;
    position: relative;
}

#user-input {
    flex: 1;
    padding: 10px;
    padding-right: 80px;
    min-width: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}

#chat-container #chat-input-area #send-message {
    position: absolute;
    right: 11px;
    top: 11px;
    bottom: 11px;
    padding: 0 15px;
    background-color: #A62B0C;
    color: white;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-container #chat-input-area #send-message:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#user-input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.loading-indicator {
    position: absolute;
    right: 15px;
    display: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ec5b5b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    margin: 5px 0;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-start;
    background-color: #e0f7fa;
}

.message.assistant {
    align-self: flex-start;
    background-color: #f1f8e9;
}

@media (max-width: 768px) {
    #chat-container {
        height: auto;
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    #chat-container {
        height: calc(40vh); /* Adjusted height for mobile */
        margin: 10px auto;
    }
    #chat-input-area {
        padding: 5px;
    }
    #user-input {
        font-size: 16px;
    }
    #chat-container #chat-input-area #send-message {
        font-size: 14px;
    }
}

#recaptcha-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.grecaptcha-badge {
    position: fixed !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 1000 !important;
    width: 70px !important;
    overflow: hidden !important;
    transition: width 0.3s !important;
}

.grecaptcha-badge.expanded {
    width: 256px !important;
}

.book-info {
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
}

.book-info-flex {
    display: flex;
    gap: 10px;
}

.book-image {
    flex-shrink: 0;
    width: 80px;
}

.book-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.book-details {
    flex-grow: 1;
}

.book-details h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.book-details p {
    margin: 0 0 5px 0;
}

.book-description {
    margin: 10px 0;
    font-size: 12px;
}

.book-buy-link {
    display: inline-block;
    background-color: #A62B0C;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
}

.book-buy-link:hover {
    background-color: #8a2409;
}