.message {
    max-width: 80%;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 0.5rem;
}

.user-message {
    /* background-color: #e3f2fd; */
    margin-left: auto;
}

.bot-message {
    background-color: #f5f5f5;
    margin-right: auto;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    margin: 0.5rem auto;
    text-align: center;
}

.chat-item.active {
    background-color: #4a5568;
}

#chat-messages {
    height: calc(100vh - 130px);
}

.chat-item {
    transition: background-color 0.2s;
}

.chat-item:hover .edit-btn {
    opacity: 1;
}

.edit-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

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

#editTitleModal {
    transition: opacity 0.2s;
}

.delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-item:hover .delete-btn {
    opacity: 1;
}

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

.document-item:hover .delete-btn {
    opacity: 1;
}

/* Search result and highlight styles */
.search-result {
    background-color: #f3f4f6;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.search-result-title {
    color: #4b5563;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.highlight {
    background-color: rgba(59, 130, 246, 0.2);
    border-bottom: 2px solid #3b82f6;
}

.highlight.active {
    background-color: rgba(59, 130, 246, 0.4);
}

/* PDF viewer styles */
.pdf-page-container {
    margin-bottom: 1rem;
}

.pdf-text-layer {
    opacity: 0.2;
    line-height: 1.0;
}

.pdf-text-layer span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* Highlight animations */
.highlight {
    animation: highlightFade 0.5s ease-out forwards;
    position: relative;
    z-index: 1;
}

.highlight.active {
    animation: activeHighlightPulse 2s ease-in-out infinite;
}

@keyframes highlightFade {
    from {
        background-color: rgba(59, 130, 246, 0);
        border-bottom-color: rgba(59, 130, 246, 0);
    }
    to {
        background-color: rgba(59, 130, 246, 0.2);
        border-bottom-color: rgba(59, 130, 246, 1);
    }
}

@keyframes activeHighlightPulse {
    0% {
        background-color: rgba(59, 130, 246, 0.2);
    }
    50% {
        background-color: rgba(59, 130, 246, 0.4);
    }
    100% {
        background-color: rgba(59, 130, 246, 0.2);
    }
}

/* Search result animations */
.search-result {
    animation: slideDown 0.3s ease-out forwards;
    transform-origin: top;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect for search results */
.search-result {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

/* Add to existing CSS */
.navbar {
    background-color: #2c3e50;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #34495e;
}

.content {
    padding: 2rem;
}

/* Ensure duplicate modal is always on top of other modals */
#duplicate-modal {
    z-index: 60 !important;
} 