/* Results Page Styles */

.results-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.results-main {
    flex: 1;
    padding-top: 4rem; /* Account for fixed header */
}

.results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.results-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading animation */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 1rem;
}

.loading-spinner svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Component fade-in animation */
.component-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.component-fade-in.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Results Page Specific Styles */

/* Primary color consistency */
.text-primary {
    color: #3B82F6 !important;
}

.bg-primary {
    background-color: #3B82F6 !important;
}

.hover\:bg-primary-dark:hover {
    background-color: #2563EB !important;
}

.border-primary {
    border-color: #3B82F6 !important;
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Result Card Styling */
.result-card {
    min-height: 480px; /* Increased minimum height */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.result-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
    border-color: #3B82F6;
}

/* Ensure consistent height across all cards */
#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Card header spacing */
.result-card .flex.items-start {
    margin-bottom: 1rem;
}

/* Card title and description spacing */
.result-card .result-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.result-card .result-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Details sections spacing */
.result-card .grid.grid-cols-2 {
    margin-bottom: 1.5rem;
}

.result-card .bg-gray-50,
.result-card .bg-blue-50 {
    padding: 0.75rem;
    border-radius: 0.5rem;
}

/* Push action buttons to the bottom */
.result-card .flex.justify-between {
    margin-top: auto;
    padding-top: 1rem;
}

/* Improved Card Styles */
.result-card .result-title {
    color: #1e40af;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.result-card:hover .result-title {
    color: #3B82F6;
}

.result-card .result-description {
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

/* Badge Styling */
.result-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Animation for new badges */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.result-badge.badge-new, .result-badge.badge-hot {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Icon Container */
.result-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.result-card:hover .result-icon {
    transform: scale(1.05);
}

/* Button Styling */
.view-result-btn {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
    transform: translateY(0);
}

.view-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.35);
}

.share-result-btn {
    transition: all 0.2s ease;
}

.share-result-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}

/* Pagination Styles */
.pagination-btn {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover {
    background-color: #f9fafb;
    color: #3b82f6;
    border-color: #3b82f6;
}

.pagination-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn.active:hover {
    background-color: #2563eb;
}

.pagination-btn.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    background-color: white;
}

.pagination-btn.disabled:hover {
    background-color: white;
    color: #9ca3af;
}

.pagination-dots {
    padding: 0.5rem;
    color: #6b7280;
}

/* Filter Button Styles */
.filter-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #3B82F6;
    transition: width 0.3s ease, left 0.3s ease;
}

.filter-btn:hover::after {
    width: 80%;
    left: 10%;
}

/* Loading State */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Statistics Section */
.bg-blue-50 {
    background-color: rgba(239, 246, 255, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-green-50 {
    background-color: rgba(236, 253, 245, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-purple-50 {
    background-color: rgba(245, 243, 255, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-yellow-50 {
    background-color: rgba(254, 252, 232, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-blue-50:hover,
.bg-green-50:hover,
.bg-purple-50:hover,
.bg-yellow-50:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

/* Responsive Design */
@media (max-width: 768px) {
    .result-card {
        padding: 1rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        margin: 0.125rem;
    }
}

/* Smooth Transitions */
* {
    scroll-behavior: smooth;
}

/* Focus States */
.pagination-btn:focus,
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}