/* Search, Library, Projects Modals */
.search-modal,
.library-modal,
.projects-modal,
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.search-modal.show,
.library-modal.show,
.projects-modal.show,
.share-modal.show {
    opacity: 1;
}

.search-modal-content,
.library-modal-content,
.projects-modal-content,
.share-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.search-modal-content h2,
.library-modal-content h2,
.projects-modal-content h2,
.share-modal-content h2 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

#searchInput {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95em;
    margin-bottom: 16px;
}

.search-results,
.archived-chats {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.search-result-item,
.archived-chat-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-title,
.archived-chat-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-date {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.archived-chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.archived-chat-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.archived-chat-actions button:hover {
    opacity: 0.9;
}

.no-results {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.close-modal-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: var(--bg-hover);
}

.share-url-container {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.share-url-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9em;
}

.share-url-container button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.share-url-container button:hover {
    opacity: 0.9;
}

.create-project-btn {
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--border-secondary);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.create-project-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
