/* WooCommerce Advanced Review System - Frontend Styles */
/* File: assets/css/style.css */

.wcar-review-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header Section */
.wcar-header {
    background: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.wcar-rating-summary {
    border: 3px solid #d32f2f;
    padding: 20px 40px;
    border-radius: 8px;
    background: white;
    text-align: center;
    display: inline-block;
}

.wcar-rating-number {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.wcar-stars {
    color: #ffa726;
    font-size: 24px;
    margin: 10px 0;
}

.wcar-stars .star {
    display: inline-block;
}

.wcar-stars .star.filled {
    color: #ffa726;
}

.wcar-stars .star.half {
    position: relative;
    color: #e0e0e0;
}

.wcar-stars .star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    color: #ffa726;
    overflow: hidden;
    width: 50%;
}

.wcar-stars .star.empty {
    color: #e0e0e0;
}

.wcar-review-count {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.wcar-reviews-link {
    background: #000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.wcar-write-review-btn {
    background: white;
    color: #000;
    border: 2px solid #d32f2f;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.wcar-write-review-btn:hover {
    background: #d32f2f;
    color: white;
}

/* Filter Section */
.wcar-filters {
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    max-width: 780px;
}

.wcar-filter-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 0;
}

.wcar-filter-row + .wcar-popular-tags {
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
}

.wcar-search-box {
    flex: 0 0 auto;
    width: 200px;
}

.wcar-search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.wcar-filter-select {
    flex: 0 0 auto;
    width: 150px;
    padding: 10px 30px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.wcar-checkbox-filter {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
}

.wcar-checkbox-filter input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wcar-checkbox-filter label {
    cursor: pointer;
    user-select: none;
}

/* Popular Tags */
.wcar-popular-tags {
    display: block;
}

.wcar-tags-label {
    font-weight: 600;
    margin-right: 15px;
    color: #333;
    display: inline-block;
    vertical-align: middle;
}

.wcar-tag-list {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    vertical-align: middle;
}

.wcar-tag {
    background: #f5f5f5;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.3s;
    white-space: nowrap;
}

.wcar-tag:hover,
.wcar-tag.active {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.wcar-tag.hidden {
    display: none;
}

.wcar-show-more {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
    padding: 0;
}

/* Sort Section */
.wcar-sort-section {
    background: white;
    border: 2px solid #ddd;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.wcar-sort-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.wcar-sort-select {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Reviews Grid */
.wcar-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wcar-review-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.wcar-review-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.wcar-review-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

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

.wcar-review-stars {
    color: #ffa726;
    font-size: 18px;
}

.wcar-review-stars .star {
    display: inline-block;
}

.wcar-review-stars .star.filled {
    color: #ffa726;
}

.wcar-review-stars .star.empty {
    color: #e0e0e0;
}

.wcar-review-date {
    color: #999;
    font-size: 12px;
}

.wcar-review-title {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    color: #333;
}

.wcar-review-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.wcar-review-meta {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.wcar-reviewer-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.wcar-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4caf50;
    font-size: 12px;
    margin-bottom: 10px;
}

.wcar-product-name {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.wcar-review-tags {
    margin-top: 10px;
}

.wcar-helpful-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.wcar-helpful-label {
    font-size: 13px;
    color: #666;
}

.wcar-helpful-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.wcar-helpful-btn:hover {
    background: #f5f5f5;
}

/* Review Form Modal */
.wcar-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    overflow-y: auto;
}

.wcar-modal.active {
    display: block;
}

.wcar-modal-content {
    background-color: white;
    margin: 30px auto;
    padding: 40px 50px;
    border-radius: 8px;
    max-width: 700px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.wcar-modal-close {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 32px;
    font-weight: normal;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.wcar-modal-close:hover {
    color: #000;
}

.wcar-form-group {
    margin-bottom: 25px;
}

.wcar-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.wcar-form-half {
    margin-bottom: 0;
}

.wcar-form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 400;
    color: #000;
    font-size: 15px;
}

.wcar-form-input,
.wcar-form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.wcar-form-input:focus,
.wcar-form-textarea:focus {
    outline: none;
    border-color: #000;
}

.wcar-form-textarea {
    min-height: 130px;
    resize: vertical;
}

.wcar-field-note {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.wcar-rating-input {
    display: flex;
    gap: 8px;
    font-size: 38px;
}

.wcar-rating-input .star {
    cursor: pointer;
    color: #d4af37;
    transition: all 0.2s;
    stroke: #d4af37;
    stroke-width: 1px;
}

.wcar-rating-input .star:not(.active) {
    color: transparent;
}

.wcar-rating-input .star.active,
.wcar-rating-input .star:hover {
    color: #d4af37;
}

.wcar-tag-select {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wcar-tag-option {
    padding: 8px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: white;
    transition: all 0.3s;
    color: #333;
}

.wcar-tag-option:hover {
    border-color: #666;
}

.wcar-tag-option.selected {
    background: #000;
    color: white;
    border-color: #000;
}

.wcar-image-upload {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.wcar-image-upload:hover {
    border-color: #666;
    background: #f5f5f5;
}

.wcar-image-upload input[type="file"] {
    display: none;
}

.wcar-image-upload p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.wcar-image-preview {
    margin-top: 15px;
}

.wcar-image-preview img {
    max-width: 200px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.wcar-required-note {
    font-size: 13px;
    color: #666;
    margin: 20px 0 25px 0;
}

.wcar-submit-btn {
    background: #000;
    color: white;
    border: none;
    padding: 14px 50px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.wcar-submit-btn:hover {
    background: #333;
}

.wcar-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading State */
.wcar-loading {
    text-align: center;
    padding: 40px;
}

.wcar-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    .wcar-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .wcar-reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .wcar-filter-row {
        flex-wrap: wrap;
    }
    
    .wcar-search-box {
        flex-basis: 100%;
    }
    
    .wcar-sort-section {
        justify-content: flex-start;
    }
    
    .wcar-modal-content {
        margin: 20px;
        padding: 30px 25px;
        max-width: calc(100% - 40px);
    }
    
    .wcar-form-row {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .wcar-rating-input {
        font-size: 32px;
        justify-content: center;
    }
    
    .wcar-modal-close {
        right: 15px;
        top: 15px;
        font-size: 28px;
    }
    
    .wcar-tag-list {
        display: flex;
    }
}