/**
 * Review List Styles
 */

/* Review Quality Colors & Variables */
.cwr-review-good {
    background-color: #e8f5e9 !important; /* Light Green */
    border-color: #c8e6c9 !important;
    --cwr-fade-color: #e8f5e9;
}

.cwr-review-bad {
    background-color: #ffebee !important; /* Light Red */
    border-color: #ffcdd2 !important;
    --cwr-fade-color: #ffebee;
}

/* Default fallback */
:root {
    --cwr-fade-color: #ffffff;
}

/* Good/Bad Selection Buttons in Form */
.cwr-review-quality-selector {
    margin-bottom: 20px;
}

.cwr-review-quality-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

.cwr-quality-options {
    display: flex;
    gap: 10px;
}

.cwr-quality-option {
    flex: 1;
    position: relative;
}

.cwr-quality-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cwr-quality-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    background: #fff;
    text-align: center;
    border-radius: 4px; /* Using similar radius to plugin styles */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.cwr-quality-btn:hover {
    background: #f5f5f5;
}

/* Selected States */
.cwr-quality-input:checked + .cwr-quality-btn {
    border-color: #0073aa; /* Plugin primary color */
    color: #0073aa;
    background: #f0f7ff;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Specific colors for Good/Bad selection if desired, or keep uniform primary */
.cwr-quality-input[value="good"]:checked + .cwr-quality-btn {
    border-color: #86dd7b;
    color: #86dd7b;
    background: #e8f5e9;
    box-shadow: 0 0 0 1px #86dd7b;
}

.cwr-quality-input[value="bad"]:checked + .cwr-quality-btn {
    border-color: #f36060;
    color: #f36060;
    background: #ffebee;
    box-shadow: 0 0 0 1px #f36060;
}

/* Accordion Styles */
.cwr-review-wrapper {
    position: relative;
    /* Ensure content containment */
}

.cwr-review-content {
    /* Base styles */
    transition: max-height 0.3s ease;
}

/* Collapsed State */
.cwr-review-wrapper.cwr-collapsed .cwr-review-content {
    max-height: 150px; /* Must match JS config */
    overflow: hidden;
    position: relative;
}

/* Gradient Mask */
.cwr-review-wrapper.cwr-collapsed .cwr-review-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Fade height */
    background: linear-gradient(to bottom, transparent, var(--cwr-fade-color, #fff));
    pointer-events: none;
}

/* Read More Button */
.cwr-read-more-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: #0073aa;
    padding: 10px 0;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    position: relative;
    z-index: 2;
}

.cwr-read-more-btn:hover {
    text-decoration: underline;
    color: #005177;
}

/* Override default comment padding if necessary to prevent double padding issues */
/* This depends on theme, but usually safe to leave alone if wrapping content */

.woocommerce #reviews #comments ol.commentlist li .comment-text {
    margin: 0;
}