/* =======================
   SEARCH, FILTERS & REVIEWS STYLES
   ======================= */

/* Search System */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #E33E10;
    box-shadow: 0 0 0 3px rgba(227, 62, 16, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #9ca3af;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover,
.search-result.focused {
    background: #f9fafb;
}

.result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #E33E10;
    font-size: 18px;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 14px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.result-price {
    color: #E33E10;
    font-weight: 600;
}

.result-action {
    color: #9ca3af;
    font-size: 14px;
    transition: color 0.2s;
}

.search-result:hover .result-action {
    color: #E33E10;
}

/* Search States */
.search-loading,
.search-error,
.search-no-results {
    padding: 24px;
    text-align: center;
    color: #6b7280;
}

.search-loading i,
.search-error i,
.search-no-results i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.search-error i {
    color: #ef4444;
}

.search-no-results i {
    color: #9ca3af;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #E33E10;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

/* Filter System */
.filter-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.btn-filter {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.btn-filter:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-filter.active {
    background: #E33E10;
    color: #fff;
    border-color: #E33E10;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-option:hover {
    background: #f9fafb;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #E33E10;
}

.filter-option label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-option .option-count {
    color: #6b7280;
    font-size: 13px;
}

.results-count {
    font-size: 14px;
    color: #6b7280;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* Rating System */
.rating-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-star {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.2s;
    font-size: 20px;
}

.rating-star:hover {
    transform: scale(1.1);
}

.rating-star.focused {
    color: #fbbf24;
}

.rating-stars:hover .rating-star {
    color: #fbbf24;
}

.rating-stars .rating-star:hover ~ .rating-star {
    color: #d1d5db;
}

.rating-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.rating-count {
    color: #6b7280;
    font-size: 14px;
}

/* Review System */
.review-item {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E33E10 0%, #ff6b4a 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.review-date {
    color: #6b7280;
    font-size: 13px;
}

.review-rating {
    display: flex;
    gap: 4px;
}

.review-stars i {
    color: #fbbf24;
    font-size: 16px;
}

.review-content {
    margin-bottom: 16px;
}

.review-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 16px;
}

.review-text {
    color: #4b5563;
    line-height: 1.6;
    font-size: 14px;
}

.review-footer {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.btn-helpful,
.btn-reply {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}

.btn-helpful:hover,
.btn-reply:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.btn-helpful.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #10b981;
}

/* Language Switcher */
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.language-switcher:hover {
    border-color: #d1d5db;
}

.language-switcher select {
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #374151;
    padding: 0;
    margin: 0;
}

.language-switcher select:focus {
    outline: none;
}

.language-icon {
    font-size: 16px;
    color: #6b7280;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .search-input {
        padding: 12px 40px 12px 16px;
        font-size: 14px;
    }

    .filter-container {
        padding: 16px;
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-filter {
        flex: 1;
        text-align: center;
    }

    .review-item {
        padding: 16px;
    }

    .review-header {
        flex-direction: column;
        gap: 12px;
    }

    .review-footer {
        flex-direction: column;
        gap: 8px;
    }

    .btn-helpful,
    .btn-reply {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .search-input,
    .search-results,
    .filter-container,
    .review-item {
        background: #1f2937;
    }

    .search-input:focus {
        border-color: #ff6b4a;
    }

    .search-result:hover,
    .search-result.focused {
        background: #374151;
    }

    .result-icon {
        background: #374151;
    }

    .result-title {
        color: #f9fafb;
    }

    .result-meta {
        color: #9ca3af;
    }

    .filter-title {
        color: #f9fafb;
    }

    .filter-option:hover {
        background: #374151;
    }

    .filter-option label {
        color: #f9fafb;
    }

    .author-name {
        color: #f9fafb;
    }

    .review-title {
        color: #f9fafb;
    }

    .review-text {
        color: #d1d5db;
    }

    .language-switcher {
        background: #1f2937;
        border-color: #374151;
    }

    .language-switcher select {
        color: #f9fafb;
    }
}
