/**
 * Search Results Component Styles
 */

/* Search Results Wrapper */
.search-results-wrapper {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.search-results-wrapper .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-results-wrapper .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
}

.search-results-wrapper .section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #666);
    margin: 0;
    flex: 1;
}

.btn-clear-search {
    padding: 0.5rem 1rem;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-clear-search:hover {
    background: var(--primary-dark, #5568d3);
    transform: translateY(-1px);
}

/* Search Form Container */
.search-form-container {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.site-filter,
.content-type-filter {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.site-filter:focus,
.content-type-filter:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.search-btn:active:not(:disabled) {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.search-btn.searching {
    opacity: 0.8;
}

.search-btn .btn-text {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.search-loading .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-loading p {
    font-size: 1.1rem;
    color: var(--text-secondary, #666);
}

/* Empty State */
.search-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.search-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-empty .empty-message {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.search-empty .empty-hint {
    font-size: 1rem;
    color: var(--text-secondary, #666);
}

/* Error State */
.search-error {
    text-align: center;
    padding: 4rem 2rem;
}

.search-error .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.search-error .error-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--error-color, #ef4444);
    margin-bottom: 1.5rem;
}

.btn-retry {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: var(--primary-dark, #5568d3);
    transform: translateY(-2px);
}

/* Search Results Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1.5rem 0;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Search Result Card - Site Card Style */
.search-result-card {
    position: relative;
    height: 100%;
    min-height: 200px;
    border-radius: 26px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    outline: none;
    background: transparent !important;
}

.search-result-card:hover {
    transform: translateY(-8px);
}

.search-result-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.search-result-card .card-surface {
    position: relative;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    background: rgba(10, 16, 28, 0.80) !important;
    border: 1px solid rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.search-result-card:hover .card-surface {
    box-shadow: 0 26px 36px rgba(102, 126, 234, 0.25);
    border-color: rgba(139, 92, 246, 0.3);
}

.search-result-card .card-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    opacity: 0.6;
}

/* Result Thumbnail */
.result-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-thumbnail .no-thumbnail {
    font-size: 3rem;
    opacity: 0.7;
}

/* Card Content */
.search-result-card .card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(18px, 3vw, 24px);
    height: 100%;
}

/* Card Header */
.search-result-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-result-card .card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.search-result-card .card-search-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(102, 126, 234, 0.25);
    color: #c4b5fd;
    backdrop-filter: blur(12px);
}

.search-result-card .card-search-badge .search-icon {
    font-size: 1rem;
}

/* Card Name */
.search-result-card .card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
}

/* Card Query */
.search-result-card .card-query {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.search-result-card .card-query .query-text {
    color: #c4b5fd;
    font-weight: 600;
}

/* Card Hint */
.search-result-card .card-hint {
    margin-top: auto;
    font-size: 0.85rem;
    color: rgba(139, 92, 246, 0.8);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-result-card .card-hint::after {
    content: '→';
    transition: transform 0.3s ease;
}

.search-result-card:hover .card-hint::after {
    transform: translateX(4px);
}

.result-description {
    font-size: 0.875rem;
    color: #666;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Result Metadata */
.result-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.result-badge.site-badge {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: var(--primary-color, #667eea);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.result-badge.site-badge::before {
    content: '⚡';
    margin-right: 0.4rem;
    font-size: 0.9rem;
}

.search-result-card:hover .result-badge.site-badge {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.result-badge.type-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.result-badge.year-badge {
    background: rgba(156, 163, 175, 0.12);
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.25);
}

/* Load More Button */
.btn-load-more {
    display: block;
    margin: 2rem auto;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-load-more:active {
    transform: translateY(0);
}

.btn-load-more .load-icon {
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-load-more:hover .load-icon {
    transform: translateY(2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-results-wrapper {
        padding: 1rem 0.5rem;
    }

    .search-results-wrapper .section-title {
        font-size: 1.5rem;
    }

    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input,
    .site-filter,
    .content-type-filter,
    .search-btn {
        width: 100%;
        min-width: auto;
    }

    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .result-thumbnail {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .search-results-wrapper .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-load-more {
        width: 90%;
        margin: 1.5rem auto;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Video Pagination */
.video-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #9ca3af;
}

.pagination-info {
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

@media (max-width: 480px) {
    .video-pagination {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pagination-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Video Site Filters */
.video-site-filters {
    margin-bottom: 1.5rem;
}

.video-site-filters .quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.video-site-filters .quick-filter-btn {
    font-size: 0.9rem;
}
