/* =====================================================
   REVIEWS PAGE STYLES
   ===================================================== */

/* Section Description */
.section-desc {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 0.95em;
}

/* Sources Grid */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Source Card */
.source-card {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.source-card:hover {
    box-shadow: var(--shadow-hover);
}

.source-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.source-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.source-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
    color: white;
}

.google-icon {
    background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335);
}

.facebook-icon {
    background: var(--facebook-color);
}

.tripadvisor-icon {
    background: #00aa6c;
    font-size: 0.85em;
}

.booking-icon {
    background: #003580;
}

.source-body {
    padding: 20px;
}

.source-body .form-group {
    margin-bottom: 15px;
}

.source-body .form-group:last-child {
    margin-bottom: 0;
}

.source-status {
    margin-top: 10px;
    font-size: 0.85em;
    padding: 8px 12px;
    border-radius: 6px;
}

.source-status.success {
    background: #e6f4ea;
    color: var(--success-color);
}

.source-status.error {
    background: #fce8e6;
    color: var(--danger-color);
}

.source-status.loading {
    background: #e8f0fe;
    color: var(--primary-color);
}

/* Search Input Group */
.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex: 1;
}

/* Place Results */
.place-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.place-result-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
}

.place-result-item:hover {
    border-color: var(--primary-color);
    background: #e8f0fe;
}

.place-result-item .place-name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.place-result-item .place-address {
    font-size: 0.85em;
    color: var(--secondary-color);
}

/* Selected Place */
.selected-place {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #e6f4ea;
    border-radius: 6px;
    margin-top: 10px;
}

.selected-place .place-name {
    font-weight: 600;
    flex: 1;
}

.selected-place .place-id {
    font-size: 0.8em;
    color: var(--secondary-color);
}

.btn-remove-place {
    background: none;
    border: none;
    font-size: 1.4em;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Sources Actions */
.sources-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.last-update {
    font-size: 0.9em;
    color: var(--secondary-color);
}

/* Filters Grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.filter-group > label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-color);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95em;
}

.checkbox-label input,
.radio-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Rating Filter Buttons */
.rating-filter {
    display: flex;
    gap: 8px;
}

.rating-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.rating-btn:hover {
    border-color: var(--primary-color);
}

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

/* Filters Actions */
.filters-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--secondary-color);
}

/* Mini Distribution */
.distribution-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-distribution {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    height: 60px;
}

.dist-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
}

.dist-fill {
    width: 100%;
    background: linear-gradient(180deg, #fbbc04, #f9a825);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

.dist-label {
    font-size: 0.75em;
    color: var(--secondary-color);
    margin-top: 4px;
}

/* Section Header with Actions */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Reviews Container */
.reviews-container {
    position: relative;
    min-height: 200px;
}

/* Review Item */
.review-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
}

.review-item:hover {
    box-shadow: var(--shadow);
}

.review-item.selected {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.review-checkbox {
    flex-shrink: 0;
    padding-top: 3px;
}

.review-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.review-main {
    flex: 1;
    min-width: 0;
}

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

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

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1em;
    flex-shrink: 0;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.review-author-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.review-author-name {
    font-weight: 600;
    color: var(--text-color);
}

.review-date {
    font-size: 0.85em;
    color: var(--secondary-color);
}

.review-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.review-source-badge {
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-source-badge.google {
    background: #e8f0fe;
    color: var(--primary-color);
}

.review-source-badge.facebook {
    background: #e7f3ff;
    color: var(--facebook-color);
}

.review-source-badge.tripadvisor {
    background: #e6f7f1;
    color: #00aa6c;
}

.review-source-badge.booking {
    background: #e6eef8;
    color: #003580;
}

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

.review-rating .star {
    color: #fbbc04;
    font-size: 1.1em;
}

.review-rating .star.empty {
    color: #dadce0;
}

.review-text {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.review-text.no-text {
    color: var(--secondary-color);
    font-style: italic;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    border-radius: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* TripAdvisor Button */
.btn-tripadvisor {
    background-color: #00aa6c;
    color: white;
}

.btn-tripadvisor:hover:not(:disabled) {
    background-color: #008c59;
}

/* Booking Button */
.btn-booking {
    background-color: #003580;
    color: white;
}

.btn-booking:hover:not(:disabled) {
    background-color: #00264d;
}

/* Export Options */
.export-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Modal Medium */
.modal-medium {
    max-width: 500px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary-color);
}

.empty-state p {
    margin: 0;
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .sources-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .bulk-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .review-item {
        flex-direction: column;
    }

    .review-header {
        flex-direction: column;
    }

    .review-meta {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
    }

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

    .rating-filter {
        flex-wrap: wrap;
    }

    .sources-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================================================
   PROXY SECTION
   ===================================================== */

#proxySection {
    background: #f8f9fa;
    border: 1px dashed var(--border-color);
}

.section-header-collapsible {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.section-header-collapsible:hover {
    opacity: 0.8;
}

.collapse-icon {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    width: 30px;
    text-align: center;
}

.collapsible-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.proxy-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item {
    font-size: 0.9em;
    color: var(--secondary-color);
}

.stat-item strong {
    color: var(--text-color);
}

.proxy-add-form {
    margin-bottom: 20px;
}

.help-text {
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-top: 8px;
}

.help-text a {
    color: var(--primary-color);
}

.proxy-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.proxy-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.proxy-item.failed {
    background: #fff5f5;
    border-color: #ffcdd2;
}

.proxy-url {
    flex: 1;
    font-family: monospace;
    color: var(--text-color);
}

.proxy-type {
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
}

.proxy-status {
    font-weight: 500;
    color: var(--success-color);
}

.proxy-item.failed .proxy-status {
    color: var(--danger-color);
}

.proxy-actions {
    display: flex;
    gap: 10px;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.no-data {
    text-align: center;
    color: var(--secondary-color);
    padding: 20px;
    font-style: italic;
}
