/* Search Page Specific Styles */

/* Search Criteria Panel */
.search-criteria-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) auto;
    max-width: 1200px;
    box-shadow: var(--shadow-card);
}

.search-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.search-header .search-container {
    flex: 1;
}

.search-type-badge {
    background: var(--action-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.search-type-badge:hover {
    background: var(--action-primary-hover, #e67e22);
    transform: translateY(-1px);
}

.search-type-badge:active {
    transform: translateY(0);
}

.result-count {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.filters-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.filter-group-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.chip {
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background: var(--bg-surface-hover);
    border-color: var(--action-primary);
}

.chip.active {
    background: var(--action-primary);
    color: white;
    border-color: var(--action-primary);
}

/* Results Header & Sorting */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--spacing-xl) auto var(--spacing-lg);
    max-width: 1200px;
}

.results-summary {
    font-size: 14px;
    color: var(--text-secondary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.sort-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) auto;
    max-width: 1200px;
    align-items: stretch;
}

.v-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.v-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.v-card-img {
    height: 240px;
    background-color: white;
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.v-card-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.v-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    mix-blend-mode: multiply;
}

.v-card-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background-color: #d32f2f;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 1;
}

.v-card-body {
    padding: var(--spacing-md);
    text-align: left;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.v-card-producer {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.v-card-producer a {
    color: inherit;
    text-decoration: none;
}

.v-card-producer a:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.v-card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-card-heading);
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
}

.v-card-title a {
    color: inherit;
    text-decoration: none;
}

.v-card-title a:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.v-card-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.v-card-meta a {
    color: inherit;
    text-decoration: none;
}

.v-card-meta a:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.v-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.v-card-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-card-heading);
    text-decoration: none;
}

.v-card-price:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.v-card-rating {
    color: var(--action-primary);
    font-weight: bold;
    text-decoration: none;
}

.v-card-rating:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.v-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.critic-badge {
    font-weight: bold;
    font-size: 11px;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: #333;
}

.collection-btn {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    font-weight: 500;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    color: inherit;
}

.collection-btn.in-collection {
    background: var(--action-primary);
    color: white;
    border-color: var(--action-primary);
}

.collection-btn.in-collection:hover {
    background: var(--action-primary-hover, #e67e22);
    border-color: var(--action-primary-hover, #e67e22);
}

.collection-btn.in-history {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.collection-btn.in-history:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.collection-btn.add-to-collection {
    background: transparent;
    color: var(--action-primary);
    border-color: var(--action-primary);
}

.collection-btn.add-to-collection:hover {
    background: var(--action-primary);
    color: white;
}

.wishlist-btn {
    border: 1px solid var(--action-primary);
    background: transparent;
    color: var(--action-primary);
    font-weight: 500;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.wishlist-btn:hover {
    background: var(--action-primary);
    color: white;
    text-decoration: none;
}

.wishlist-btn.in-wishlist {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.wishlist-btn.in-wishlist:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #666;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: var(--spacing-md);
    color: var(--text-page-heading);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: var(--spacing-lg);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin: var(--spacing-2xl) auto;
    max-width: 1200px;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1 1 auto;
}

.pagination-total {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.pagination-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--action-primary);
}

.pagination-btn.active {
    background: var(--action-primary);
    color: white;
    border-color: var(--action-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Indicator */
.results-grid.loading {
    opacity: 0.6;
    position: relative;
    pointer-events: none;
}

.results-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--action-primary, #3498db);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* Error Messages */
.search-error {
    padding: 1rem;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    margin-bottom: 1rem;
    grid-column: 1 / -1;
}

/* Result Count in Header */
.results-header .result-count {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

/* Label recognition (Search page) */
.label-recognition-panel {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    margin-top: var(--spacing-md);
}

.label-thumbnail-container {
    width: 216px;
    height: 216px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-surface);
    overflow: hidden;
    flex: 0 0 auto;
}

.label-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.label-recognition-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.label-recognition-status {
    font-size: 14px;
    color: var(--text-secondary);
}

.label-recognition-details {
    margin-top: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.label-recognition-details .label-recognition-detail-line {
    white-space: pre-wrap;
}
