#chat-box {
    height: 400px;
    overflow-y: auto;
    background: var(--dark-secondary);
    padding: 20px;
}

.user-message, .ai-message, .error-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: var(--dark-primary);
    color: var(--dark-text);
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background: var(--dark-input);
    color: var(--dark-text);
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.error-message {
    background: #dc3545;
    color: var(--dark-text);
    text-align: center;
    margin: 10px auto;
    width: 100%;
}

.loading {
    text-align: center;
    color: #6c757d;
    margin: 10px;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

#user-input {
    border-radius: 20px;
    padding: 10px 15px;
}

.input-group-append .btn {
    border-radius: 20px;
    margin-left: 10px;
}

/* Common Library Theme Styles */
:root {
    --library-primary: rgba(44, 54, 57, 0.9);
    --library-secondary: rgba(63, 78, 79, 0.95);
    --library-accent: #A27B5C;
    --library-text: #DCD7C9;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Libre Baskerville', serif;
    background-image: url('woodbg.jpg') !important;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--library-text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.library-container {
    position: relative;
    z-index: 1;
    background-color: rgba(44, 54, 57, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 30px;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: var(--shadow);
    border: 2px solid var(--library-accent);
}

.library-card {
    background-color: var(--library-secondary);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--library-accent);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.library-card:hover {
    transform: translateY(-5px);
}

.library-title {
    font-family: 'Playfair Display', serif;
    color: var(--library-accent);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.library-input {
    background-color: rgba(220, 215, 201, 0.1);
    border: 1px solid var(--library-accent);
    color: var(--library-text);
    padding: 10px 15px;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 15px;
}

.library-input:focus {
    outline: none;
    border-color: #DCD7C9;
    box-shadow: 0 0 5px rgba(220, 215, 201, 0.5);
}

.library-btn {
    background-color: var(--library-accent);
    color: var(--library-text);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.library-btn:hover {
    background-color: #8B6B4D;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.decorative-line {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--library-accent), transparent);
    margin: 20px 0;
}

.book-card {
    background-color: rgba(63, 78, 79, 0.9);
    border: 1px solid var(--library-accent);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.book-card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.book-card:hover img {
    transform: scale(1.02);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

@keyframes loading {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 200px 100%;
    animation: loading 1.5s infinite;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .library-container {
        margin: 10px;
        padding: 20px;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

.navbar {
    position: relative;
    z-index: 1000;
}

.product-grid, 
.search-container,
.product-card,
.nav-link,
form,
button,
input {
    position: relative;
    z-index: 2;
}