/* WC Stores Review Frontend Styles */

:root {
    --wc-review-primary: #007cba;
    --wc-review-secondary: #f5f5f5;
    --wc-review-border: #e0e0e0;
    --wc-review-text: #333;
    --wc-review-text-light: #666;
    --wc-review-rating: #ffb900;
}

/* Widget Container */
.wc-stores-review-widget {
    background: white;
    border: 1px solid var(--wc-review-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wc-stores-review-widget-header {
    background: var(--wc-review-secondary);
    padding: 20px;
    border-bottom: 1px solid var(--wc-review-border);
}

.wc-stores-review-widget-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wc-review-text);
}

.wc-stores-review-widget-content {
    padding: 20px;
}

.wc-stores-review-widget-footer {
    padding: 20px;
    border-top: 1px solid var(--wc-review-border);
    text-align: center;
}

/* Review Card Grid */
.wc-stores-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

.wc-stores-review-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Review Card */
.wc-stores-review-card {
    background: white;
    border: 1px solid var(--wc-review-border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wc-stores-review-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--wc-review-primary);
}

/* Card Header */
.review-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.reviewer-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.reviewer-avatar-small {
    flex-shrink: 0;
}

.reviewer-avatar-small img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--wc-review-secondary);
}

.reviewer-details {
    flex: 1;
    min-width: 0;
}

.reviewer-name {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--wc-review-text);
    word-break: break-word;
}

.reviewer-store {
    margin: 0;
    font-size: 12px;
    color: var(--wc-review-text-light);
}

/* Rating Badge */
.review-rating-badge {
    flex-shrink: 0;
}

.stars-small {
    display: flex;
    gap: 2px;
    font-size: 14px;
}

.star {
    color: #ddd;
    transition: color 0.2s;
}

.star.filled {
    color: var(--wc-review-rating);
}

/* Review Date */
.review-date-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wc-review-border);
}

.review-date-text {
    font-size: 12px;
    color: var(--wc-review-text-light);
    font-weight: 500;
}

/* Review Content */
.review-content-section {
    flex: 1;
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--wc-review-text);
    font-size: 13px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-content-section p {
    margin: 0 0 8px 0;
}

.review-content-section p:last-child {
    margin-bottom: 0;
}

/* Review Footer */
.review-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wc-review-border);
    flex-wrap: wrap;
}

.review-source-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wc-review-text-light);
}

.source-icon {
    width: 18px;
    height: 18px;
    color: var(--wc-review-primary);
}

.review-view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--wc-review-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.review-view-link:hover {
    gap: 8px;
}

.link-arrow {
    font-size: 14px;
}

/* List View (for all-reviews-page) */
.wc-stores-review-grid .wc-stores-review-card {
    margin-bottom: 0;
}

/* Filters */
.wc-stores-review-filters {
    background: var(--wc-review-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: center;
}

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

.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--wc-review-text);
}

.filter-select,
.filter-group button {
    padding: 8px 12px;
    border: 1px solid var(--wc-review-border);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.filter-select:focus,
.filter-group button:focus {
    outline: 2px solid var(--wc-review-primary);
    outline-offset: -1px;
}

.filter-group button {
    background: var(--wc-review-primary);
    color: white;
    font-weight: 600;
    border-color: var(--wc-review-primary);
}

.filter-group button:hover {
    opacity: 0.9;
}

/* Pagination */
.wc-stores-review-pagination {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--wc-review-border);
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--wc-review-border);
    border-radius: 4px;
    color: var(--wc-review-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.page-numbers:hover {
    background: var(--wc-review-primary);
    color: white;
    border-color: var(--wc-review-primary);
}

.page-numbers.current {
    background: var(--wc-review-primary);
    color: white;
    border-color: var(--wc-review-primary);
}

.page-numbers.dots {
    border: none;
    cursor: default;
}

/* Button Styles */
.button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border: 1px solid var(--wc-review-border);
    border-radius: 4px;
    background: white;
    color: var(--wc-review-text);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.button:hover {
    background: var(--wc-review-secondary);
}

.button-primary {
    background: var(--wc-review-primary);
    color: white;
    border-color: var(--wc-review-primary);
}

.button-primary:hover {
    opacity: 0.9;
}

.wc-stores-review-view-all {
    width: 100%;
}

/* Empty State */
.wc-stores-review-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--wc-review-text-light);
}

.wc-stores-review-empty p {
    margin: 0;
    font-size: 16px;
}

/* Page Title */
.wc-stores-review-page h1 {
    margin-bottom: 24px;
    color: var(--wc-review-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-stores-review-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .review-card-header {
        flex-wrap: wrap;
    }

    .wc-stores-review-widget-title {
        font-size: 18px;
    }

    .pagination {
        justify-content: center;
    }

    .page-numbers {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wc-stores-review-widget {
        border-radius: 0;
    }

    .wc-stores-review-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wc-stores-review-card {
        padding: 12px;
    }

    .review-card-header {
        gap: 8px;
    }

    .reviewer-avatar-small img {
        width: 36px;
        height: 36px;
    }

    .reviewer-name {
        font-size: 14px;
    }

    .review-content-section {
        font-size: 12px;
    }

    .stars-small {
        font-size: 12px;
    }

    .pagination {
        gap: 2px;
    }

    .page-numbers {
        min-width: 28px;
        height: 28px;
        padding: 0 4px;
        font-size: 12px;
    }

    .filter-group button {
        width: 100%;
    }
}
