/* Reviews Styles - Green Magnolia */

/* ==========================================================================
   REVIEWS SECTION
   ========================================================================== */

.reviews-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.reviews-section h2 {
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   RATING SUMMARY
   ========================================================================== */

.rating-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.rating-summary.empty {
    display: block;
    text-align: center;
    padding: 2rem;
}

.rating-summary.empty p {
    margin: 0;
    color: #666;
}

.rating-summary.empty .be-first {
    margin-top: 0.5rem;
    color: var(--primary-color, #2d5a27);
    font-weight: 500;
}

.rating-overview {
    text-align: center;
    min-width: 120px;
}

.rating-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rating-overview .stars-container {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.rating-total {
    color: #666;
    font-size: 0.9rem;
}

.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-label {
    width: 50px;
    font-size: 0.85rem;
    color: #666;
}

.rating-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--primary-color, #2d5a27);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-count {
    width: 30px;
    text-align: right;
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 600px) {
    .rating-summary {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   STARS
   ========================================================================== */

.stars-container {
    display: inline-flex;
    gap: 0.125rem;
}

.stars-container .star,
.stars-container .star-btn {
    color: #d1d5db;
    font-size: 1.125rem;
}

.stars-container .star.filled,
.stars-container .star-btn.filled {
    color: #f59e0b;
}

.stars-container.interactive .star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
    transition: transform 0.1s;
}

.stars-container.interactive .star-btn:hover {
    transform: scale(1.2);
}

/* ==========================================================================
   WRITE REVIEW
   ========================================================================== */

.write-review {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.write-review h3 {
    margin: 0 0 1rem;
}

.review-form-auth {
    text-align: center;
    padding: 1rem;
    color: #666;
}

.review-form-auth a {
    color: var(--primary-color, #2d5a27);
    font-weight: 500;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.review-form .form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.review-form input[type="text"],
.review-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.review-form input:focus,
.review-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #2d5a27);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.review-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Photo Upload */
.photo-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.photo-previews {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.photo-preview {
    position: relative;
    width: 80px;
    height: 80px;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.photo-preview .remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

/* ==========================================================================
   REVIEWS LIST
   ========================================================================== */

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reviews-header h3 {
    margin: 0;
}

.reviews-header select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

#reviews-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   REVIEW CARD
   ========================================================================== */

.review-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
}

.review-card .review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.review-user-info {
    display: flex;
    flex-direction: column;
}

.review-author {
    font-weight: 500;
    color: #333;
}

.review-date {
    font-size: 0.85rem;
    color: #888;
}

.review-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #333;
}

.review-body {
    color: #444;
    line-height: 1.6;
    margin: 0 0 1rem;
}

/* Review Photos */
.review-photos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.review-photos img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.review-photos img:hover {
    transform: scale(1.05);
}

/* Review Actions */
.review-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.review-votes {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.vote-btn svg {
    fill: currentColor;
}

.vote-btn.helpful:hover {
    color: var(--primary-color, #2d5a27);
    border-color: var(--primary-color, #2d5a27);
}

.vote-btn.unhelpful:hover {
    color: #dc2626;
    border-color: #dc2626;
}

/* ==========================================================================
   REPLIES
   ========================================================================== */

.review-replies {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.reply {
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.reply.store-reply {
    background: #f0fdf4;
    border-left: 3px solid var(--primary-color, #2d5a27);
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.store-badge {
    background: var(--primary-color, #2d5a27);
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.reply-author {
    font-weight: 500;
}

.reply-date {
    color: #888;
}

.reply-body {
    margin: 0;
    color: #444;
    line-height: 1.5;
}

/* Reply Form */
.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.reviews-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.reviews-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.reviews-pagination .page-btn:hover {
    border-color: var(--primary-color, #2d5a27);
    color: var(--primary-color, #2d5a27);
}

.reviews-pagination .page-btn.active {
    background: var(--primary-color, #2d5a27);
    border-color: var(--primary-color, #2d5a27);
    color: #fff;
}

/* ==========================================================================
   PHOTO MODAL
   ========================================================================== */

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

/* ==========================================================================
   LOADING & ERROR STATES
   ========================================================================== */

.loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {
    .review-card .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .review-actions {
        flex-wrap: wrap;
    }

    .write-review {
        padding: 1rem;
    }
}

/* ==========================================================================
   PRODUCT CARD RATINGS
   ========================================================================== */

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0.375rem 0;
    font-size: 0.875rem;
}

.product-rating .stars {
    display: inline-flex;
    gap: 1px;
}

.product-rating .star {
    color: #d1d5db;
    font-size: 0.875rem;
}

.product-rating .star.filled {
    color: #f59e0b;
}

.product-rating .star.half {
    color: #f59e0b;
    opacity: 0.6;
}

.product-rating .rating-count {
    color: #666;
    font-size: 0.8rem;
}

.product-rating .no-reviews {
    color: #999;
    font-size: 0.8rem;
    font-style: italic;
}

.write-review-btn {
    background: none;
    border: 1px solid var(--primary-color, #2d5a27);
    color: var(--primary-color, #2d5a27);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.write-review-btn:hover {
    background: var(--primary-color, #2d5a27);
    color: #fff;
}

/* ==========================================================================
   REVIEW MODAL
   ========================================================================== */

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.review-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.review-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.review-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.review-modal-close:hover {
    color: #333;
}

.review-modal-content h2 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    padding-right: 2rem;
}

.star-rating-input {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.star-rating-input .star-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}

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

.star-rating-input .star-btn.filled {
    color: #f59e0b;
}

.review-modal .form-group {
    margin-bottom: 1.25rem;
}

.review-modal .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.review-modal input[type="text"],
.review-modal textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.review-modal input:focus,
.review-modal textarea:focus {
    outline: none;
    border-color: var(--primary-color, #2d5a27);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.review-modal textarea {
    resize: vertical;
    min-height: 100px;
}

.review-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ==========================================================================
   ORDER CARDS - Profile Page
   ========================================================================== */

.user-orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-order-card {
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #333);
    transition: border-color 0.2s;
}

.user-order-card:hover {
    border-color: var(--accent-green, #2d5a27);
}

.user-order-card .order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.user-order-card .order-id {
    font-weight: 700;
    font-family: var(--font-heading, monospace);
    color: var(--accent-green, #2d5a27);
    font-size: 1.1rem;
}

.user-order-card .order-date {
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
}

.user-order-card .order-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.user-order-card .order-location {
    color: var(--text-primary, #fff);
}

.user-order-card .order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.user-order-card .order-status.status-ready {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.user-order-card .order-status.status-completed {
    background: rgba(45, 90, 39, 0.2);
    color: var(--accent-green, #2d5a27);
}

.user-order-card .order-status.status-cancelled {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.user-order-card .order-total {
    margin-bottom: 1rem;
    color: var(--text-secondary, #888);
}

.user-order-card .order-total strong {
    color: var(--text-primary, #fff);
    font-size: 1.1rem;
}

.user-order-card .btn {
    width: 100%;
}

@media (max-width: 480px) {
    .user-order-card .order-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
