/**
 * CMBs Advanced Search Styles
 *
 * @package Apify_Automation
 */

/* Container */
.cmbs-search-page {
    padding: 40px 0;
    background: #f8f9fa;
}

.cmbs-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.cmbs-search-header {
    text-align: center;
    margin-bottom: 30px;
}

.cmbs-search-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.cmbs-search-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

/* Search Form */
.cmbs-search-form-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.cmbs-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cmbs-search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.cmbs-search-field {
    display: flex;
    flex-direction: column;
}

.cmbs-search-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.cmbs-select,
.cmbs-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cmbs-select:focus,
.cmbs-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.cmbs-select:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.cmbs-select-small {
    padding: 8px 12px;
    font-size: 0.875rem;
}

.cmbs-search-keyword {
    grid-column: span 2;
}

/* Buttons */
.cmbs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cmbs-btn-primary {
    background: #0066cc;
    color: #fff;
}

.cmbs-btn-primary:hover {
    background: #0052a3;
}

.cmbs-btn-secondary {
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #dee2e6;
}

.cmbs-btn-secondary:hover {
    background: #f8f9fa;
}

.cmbs-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.cmbs-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cmbs-spin 0.8s linear infinite;
}

@keyframes cmbs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Header */
.cmbs-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.cmbs-results-count {
    font-size: 1rem;
    color: #6c757d;
}

.cmbs-results-count span {
    font-weight: 700;
    color: #1a1a2e;
}

.cmbs-results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cmbs-results-sort label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Results Grid */
.cmbs-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Listing Card */
.cmbs-listing-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cmbs-listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cmbs-listing-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e9ecef;
}

.cmbs-listing-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.cmbs-listing-content {
    padding: 20px;
}

.cmbs-listing-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 10px;
    line-height: 1.4;
}

.cmbs-listing-title a {
    color: inherit;
    text-decoration: none;
}

.cmbs-listing-title a:hover {
    color: #0066cc;
}

.cmbs-listing-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 12px;
}

.cmbs-listing-location svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.cmbs-listing-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cmbs-stars {
    display: flex;
    gap: 2px;
}

.cmbs-star {
    width: 16px;
    height: 16px;
    color: #ffc107;
}

.cmbs-star-empty {
    color: #dee2e6;
}

.cmbs-rating-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.cmbs-rating-text strong {
    color: #1a1a2e;
}

.cmbs-listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.cmbs-listing-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #0066cc;
    text-decoration: none;
}

.cmbs-listing-meta a:hover {
    text-decoration: underline;
}

/* Loading State */
.cmbs-loading {
    text-align: center;
    padding: 60px 20px;
}

.cmbs-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: cmbs-spin 1s linear infinite;
}

.cmbs-loading p {
    color: #6c757d;
    font-size: 1rem;
}

/* No Results */
.cmbs-no-results,
.cmbs-initial-message {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.cmbs-no-results-icon,
.cmbs-initial-icon {
    color: #adb5bd;
    margin-bottom: 20px;
}

.cmbs-no-results h3,
.cmbs-initial-message h3 {
    font-size: 1.25rem;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.cmbs-no-results p,
.cmbs-initial-message p {
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
}

/* Pagination */
.cmbs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cmbs-page-info {
    font-size: 0.875rem;
    color: #6c757d;
}

.cmbs-page-info span {
    font-weight: 600;
    color: #1a1a2e;
}

/* Responsive */
@media (max-width: 768px) {
    .cmbs-search-title {
        font-size: 1.75rem;
    }

    .cmbs-search-form-wrapper {
        padding: 20px;
    }

    .cmbs-search-row {
        grid-template-columns: 1fr;
    }

    .cmbs-search-keyword {
        grid-column: span 1;
    }

    .cmbs-results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .cmbs-results-grid {
        grid-template-columns: 1fr;
    }

    .cmbs-pagination {
        flex-wrap: wrap;
    }
}
