/**
 * WooCommerce Product Reviews Display - Main Stylesheet
 */

/* Reviews Container */
.woo-reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Main Tabs */
.woo-reviews-main-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.woo-reviews-main-tab {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.woo-reviews-main-tab:hover {
    color: #333;
    background-color: #f9f9f9;
}

.woo-reviews-main-tab.active {
    color: #333;
    border-bottom-color: #333;
    background-color: #f5f5f5;
}

/* Review Modal */
.woo-review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woo-review-modal.open {
    display: block;
    opacity: 1;
}

.woo-reviews-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.woo-reviews-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.woo-reviews-average {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.woo-reviews-average-rating {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
    color: #333;
}

.woo-reviews-based-on {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
}

.woo-reviews-rating-bars {
    flex-grow: 1;
    padding-left: 40px;
    max-width: 500px;
}

.woo-reviews-rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.woo-reviews-rating-row:hover {
    background-color: #f5f5f5;
}

.woo-reviews-rating-row.active {
    background-color: #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.woo-reviews-rating-stars {
    width: 80px;
    display: flex;
}

.woo-reviews-rating-bar-container {
    flex-grow: 1;
    height: 12px;
    background-color: #e5e5e5;
    border-radius: 10px;
    margin: 0 10px;
    overflow: hidden;
}

.woo-reviews-rating-bar {
    height: 100%;
    background-color: #ffc107;
    border-radius: 10px;
}

.woo-reviews-rating-count {
    width: 30px;
    font-size: 12px;
    color: #777;
    text-align: right;
}

.woo-reviews-write-review {
    margin-left: 20px;
}

.woo-reviews-write-review a,
.woo-reviews-write-review button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
    border: none;
    box-shadow:none;
}

.woo-reviews-write-review a:hover,
.woo-reviews-write-review button:hover {
    background-color: #555;
}

/* Reviews List */
.woo-reviews-list {
    margin-top: 30px;
}

.woo-reviews-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.woo-reviews-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
}

.woo-reviews-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-right: 10px;
    font-weight: 500;
}

.woo-reviews-tab.active {
    border-bottom-color: #333;
}

.woo-reviews-sort {
    display: flex;
    align-items: center;
}

.woo-reviews-sort label {
    margin-right: 10px;
    font-weight: 500;
}

.woo-reviews-sort-dropdown {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* Review Item */
.woo-review-item {
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    transition: box-shadow 0.3s;
}

.woo-review-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.woo-review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.woo-review-author {
    display: flex;
    align-items: center;
}

.woo-review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

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

.woo-review-author-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.woo-review-verified {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

.woo-review-location {
    font-size: 12px;
    color: #777;
}

.woo-review-date {
    font-size: 12px;
    color: #777;
    text-align: right;
}

.woo-review-rating {
    display: flex;
    margin-bottom: 10px;
}

.woo-review-rating .star {
    color: #ffc107;
    font-size: 18px;
    margin-right: 2px;
}

.woo-review-product {
    font-size: 14px;
    margin-bottom: 10px;
}

.woo-review-product a {
    color: #333;
    text-decoration: underline;
    font-weight: 500;
}

.woo-review-product a:hover {
    text-decoration: none;
}

.woo-review-content {
    line-height: 1.6;
    color: #333;
}

/* Loading and Load More */
.woo-reviews-loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.woo-reviews-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.woo-reviews-stars{
    color: #ffc107;
    font-size: 24px;
}

.woo-reviews-rating-stars{
    color: #ffc107;
}

/* Review Modal Styles */
.woo-review-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woo-review-modal.open {
    display: block;
    opacity: 1;
}

.woo-review-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.woo-review-modal.open .woo-review-modal-content {
    transform: translateY(0);
}

.woo-review-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    transition: color 0.2s;
}

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

.woo-review-form-container {
    margin-top: 20px;
}

.woo-review-form-rating-stars {
    display: flex;
    margin-bottom: 15px;
}

.woo-review-form-rating-stars span {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    margin-right: 5px;
    transition: color 0.2s;
}

.woo-review-form-rating-stars span:hover,
.woo-review-form-rating-stars span.active {
    color: #ffc107;
}

.woo-review-form-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.woo-review-success {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

#woo-review-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#woo-review-form input[type="text"],
#woo-review-form input[type="email"],
#woo-review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: inherit;
}

#woo-review-form textarea {
    height: 120px;
    resize: vertical;
}

#woo-review-form button[type="submit"] {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#woo-review-form button[type="submit"]:hover {
    background-color: #555;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .woo-reviews-summary {
        flex-direction: column;
    }
    
    .woo-reviews-rating-bars {
        padding-left: 0;
        margin-top: 20px;
        max-width: 100%;
        width: 100%;
    }
    
    .woo-reviews-write-review {
        margin-left: 0;
        margin-top: 20px;
        text-align: center;
    }
    
    .woo-review-header {
        flex-direction: column;
    }
    
    .woo-review-date {
        text-align: left;
        margin-top: 10px;
    }

    .woo-review-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}