/* ============================================================================
 * SEARCH RESULTS ENHANCED - CSS Styles
 * Styling for improved search results display
 * ========================================================================== */

/* Document Card Styles */
.document-card {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color, #0066cc);
}

.document-card .card-body {
    padding: 1.5rem;
}

/* Document Image Container */
.document-image-container {
    width: 120px;
    height: 180px;
    overflow: hidden;
    border-radius: 10px;
}

.document-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.document-image-container .bg-gradient-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
}

/* Document Metadata */
.document-metadata {
    line-height: 1.8;
}

.metadata-item {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.metadata-item i {
    width: 18px;
    text-align: center;
}

/* Facet Styles */
.facet-header h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.facet-list {
    max-height: 300px;
    overflow-y: auto;
}

.facet-list::-webkit-scrollbar {
    width: 6px;
}

.facet-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.facet-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.facet-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.facet-item {
    border-bottom: 1px solid #f0f0f0;
}

.facet-item:last-child {
    border-bottom: none;
}

.facet-link {
    text-decoration: none;
    color: #495057;
    transition: all 0.2s ease;
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
}

.facet-link:hover {
    background-color: rgba(0, 102, 204, 0.08);
    color: var(--primary-color, #0066cc);
    transform: translateX(3px);
}

.facet-link .facet-label {
    flex: 1;
    font-size: 0.9rem;
}

.facet-link .badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Resource Stats */
.resource-stats .stat-item {
    transition: all 0.2s ease;
}

.resource-stats .stat-item:hover {
    transform: scale(1.02);
}

/* Results Header */
.results-header {
    border: 1px solid #dee2e6;
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%);
}

.results-header h5 {
    color: #2c3e50;
}

.results-header strong {
    color: var(--primary-color, #0066cc);
    font-size: 1.1em;
}

/* View Toggle Buttons */
.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn.active {
    background-color: var(--primary-color, #0066cc);
    color: white;
    border-color: var(--primary-color, #0066cc);
}

/* Filter Card (Facets Container) */
.filter-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.filter-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filter-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-primary {
    background-color: var(--primary-color, #0066cc) !important;
}

/* Button Enhancements */
.btn-outline-primary {
    border-color: var(--primary-color, #0066cc);
    color: var(--primary-color, #0066cc);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color, #0066cc);
    border-color: var(--primary-color, #0066cc);
    color: white;
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Animation classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate__animated {
    animation-duration: 0.5s;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* No Results Message */
.text-center.py-5 {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .document-image-container {
        width: 80px;
        height: 120px;
    }
    
    .document-card .card-body {
        padding: 1rem;
    }
    
    .metadata-item {
        font-size: 0.85rem;
    }
    
    .results-header {
        padding: 1rem !important;
    }
    
    .filter-card {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .document-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .facet-card,
    .results-header .btn-group,
    .btn-group {
        display: none !important;
    }
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color, #0066cc) 0%, #004499 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}
