/**
 * Search AI Frontend Styles
 */

.search-ai-widget {
    max-width: 600px;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-ai-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-ai-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: border-color 0.3s ease;
}

.search-ai-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.search-ai-button {
    padding: 12px 30px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-ai-button:hover {
    background: #005a87;
}

.search-ai-button:active {
    background: #004a6f;
}

.search-ai-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-ai-result {
    margin-top: 20px;
}

.search-ai-response {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-ai-answer {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

.search-ai-answer p {
    margin: 0 0 15px 0;
}

.search-ai-answer h2,
.search-ai-answer h3,
.search-ai-answer h4 {
    margin: 20px 0 10px 0;
    color: #0073aa;
}

.search-ai-answer ul,
.search-ai-answer ol {
    margin: 15px 0;
    padding-left: 30px;
}

.search-ai-answer li {
    margin: 8px 0;
}

.search-ai-sources {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.search-ai-sources h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
}

.search-ai-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-ai-sources li {
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-ai-sources li:last-child {
    border-bottom: none;
}

.search-ai-sources a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.search-ai-sources a:hover {
    text-decoration: underline;
}

.search-ai-sources .domain {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

/* Loading state */
.search-ai-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: search-ai-spin 1s linear infinite;
}

@keyframes search-ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.search-ai-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success state */
.search-ai-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-ai-widget {
        padding: 15px;
    }
    
    .search-ai-input-group {
        flex-direction: column;
    }
    
    .search-ai-button {
        width: 100%;
    }
    
    .search-ai-response {
        padding: 15px;
    }
}

/* Responsive tables */
.csw-responsive-table {
    overflow-x: auto;
    margin: 20px 0;
}

.csw-responsive-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.csw-responsive-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.csw-responsive-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.csw-responsive-table tr:hover {
    background: #f9f9f9;
}

@media (max-width: 768px) {
    .csw-responsive-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .csw-responsive-table table {
        min-width: 500px;
    }
}

/* Print styles */
@media print {
    .search-ai-input-group,
    .search-ai-button {
        display: none;
    }
    
    .search-ai-response {
        border: none;
        box-shadow: none;
    }
}
