/**
 * RAG Search UI Styles for WCAG Issues Library
 */

/* Ask AI Button */
.ask-ai-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color, #4CAF50);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.ask-ai-button:hover {
    background-color: var(--primary-color-dark, #3e8e41);
}

.ai-icon {
    font-size: 1.2em;
}

/* RAG Search Overlay */
#rag-search-overlay.rag-overlay {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    max-height: 500px;
    z-index: 998;
    box-sizing: border-box;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

#rag-search-overlay.rag-overlay.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
    animation: slideUpIn 0.3s ease-out;
}

#rag-search-overlay .overlay-content {
    background-color: var(--bg-primary, #fff);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    height: 100%;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#rag-search-overlay .overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #ddd);
    background-color: var(--primary-color, #4CAF50);
    color: white;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

#rag-search-overlay .overlay-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

#rag-search-overlay .overlay-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    line-height: 1;
}

#rag-search-overlay .overlay-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* Animation for overlay */
@keyframes slideUpIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Semantic Search is now implemented as an overlay */

/* Toggle Container is no longer needed with overlay approach */

/* Toggle label is no longer needed with overlay approach */

/* Search Input Container */
.semantic-search-input-container {
    display: flex;
    margin-bottom: 1rem;
}

.semantic-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s;
}

.semantic-search-button {
    padding: 0.75rem 1.5rem;
    background-color: #4CAF50;
    color: white;
    font-weight: 500;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.semantic-search-button:hover {
    background-color: #3e8e41;
}

/* Status Container */
.semantic-search-status {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.semantic-search-status.error {
    color: #d32f2f;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Results Container */
.semantic-search-results {
    margin-top: 1rem;
}

.semantic-search-results-header {
    margin-bottom: 1rem;
}

.semantic-search-results-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #333;
}

.semantic-search-results-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.semantic-search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.semantic-search-result-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.semantic-search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-title {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.result-score {
    padding: 0.25rem 0.5rem;
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: 12px;
}

.result-wcag {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-compliance,
.result-level {
    padding: 0.25rem 0.5rem;
    background-color: #e3f2fd;
    color: #1565c0;
    font-size: 0.8rem;
    border-radius: 4px;
}

.result-severity {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.result-severity.critical {
    background-color: #ffebee;
    color: #c62828;
}

.result-severity.serious {
    background-color: #fff8e1;
    color: #ff8f00;
}

.result-severity.moderate {
    background-color: #fff8e1;
    color: #f57c00;
}

.result-severity.minor {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.result-description {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.view-result-btn {
    padding: 0.5rem 1rem;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.view-result-btn:hover {
    background-color: #e0e0e0;
}

.view-result-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Highlighted Row */
.highlighted-row {
    background-color: #fff9c4 !important;
    transition: background-color 0.5s;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .semantic-search-input-container {
        flex-direction: column;
    }
    
    .semantic-search-input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    .semantic-search-button {
        border-radius: 4px;
        width: 100%;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-score {
        margin-top: 0.5rem;
    }
}