/* Plugin Styles: Ermu Sale Item Comments */

.sale-item-comments {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* More subtle shadow */
}

/* Header */
.sale-item-comments__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sale-item-comments__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #333;
}

/* Alert */
.sale-item-comments__alert {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}
.sale-item-comments__alert.is-hidden { display: none; }
.sale-item-comments__alert-filter-btn {
    background: #fff;
    border: 1px solid #c53030;
    color: #c53030;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
}

/* Tabs */
.sale-item-comment-form__tabs {
    display: flex;
    border-bottom: 2px solid #edf2f7;
    margin-bottom: 20px;
}

.sale-item-comment-form__tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    color: #718096;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.sale-item-comment-form__tab.is-active {
    color: #3182ce;
    border-bottom-color: #3182ce;
}

/* Rating */
.sale-item-comment-form__rating.is-hidden {
    display: none;
}
.sale-item-comment-form__rating {
    margin-bottom: 15px;
    background: #fffaf0;
    padding: 10px;
    border-radius: 6px;
    display: inline-block;
}
.sale-item-comment-form__label {
    font-weight: bold;
    margin-right: 10px;
    color: #d69e2e;
}
.sale-item-comment-form__stars {
    display: inline-flex;
    flex-direction: row-reverse;
}
.sale-item-comment-form__stars input { display: none; }
.sale-item-comment-form__stars label {
    font-size: 1.4rem;
    color: #e2e8f0;
    cursor: pointer;
    padding: 0 1px;
    transition: color 0.1s;
}
.sale-item-comment-form__stars input:checked ~ label,
.sale-item-comment-form__stars label:hover,
.sale-item-comment-form__stars label:hover ~ label {
    color: #ecc94b;
}

/* Chat Form Area */
.sale-item-comment-form {
    position: relative;
    transition: opacity 0.3s;
}

.sale-item-comment-form__chat {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #f7fafc;
    transition: border 0.2s, background 0.2s;
}
.sale-item-comment-form__chat:focus-within {
    background: #fff;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}
.sale-item-comment-form__chat.is-mentioning textarea {
    padding-top: 30px; /* Space for badge */
}

/* Mention Badge */
.sale-item-comment-form__mention {
    position: absolute;
    top: 10px;
    left: 12px;
    background: #ebf8ff;
    color: #2c5282;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: bold;
    display: none;
    pointer-events: none;
}
.sale-item-comment-form__mention.is-visible { display: inline-block; }

.sale-item-comment-form__chat textarea {
    width: 100%;
    border: none;
    background: transparent;
    min-height: 80px;
    resize: vertical;
    font-size: 1rem;
    line-height: 1.5;
}
.sale-item-comment-form__chat textarea:focus { outline: none; }

.sale-item-comment-form__chat-actions {
    text-align: right;
    margin-top: 10px;
}
.sale-item-comment-submit {
    background: #3182ce;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 99px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.sale-item-comment-submit:hover { background: #2b6cb0; }
.sale-item-comment-submit:disabled { opacity: 0.6; cursor: wait; }

/* Guest Overlay - IMPROVED */
.sale-item-comment-form__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.sale-item-comment-form.is-unlocked .sale-item-comment-form__overlay {
    display: none;
}

.sale-item-comment-form__overlay-card {
    background: #fff;
    padding: 24px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    width: 90%;
    max-width: 320px;
    border: 1px solid #e2e8f0;
}
.sale-item-comment-form__overlay-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}
.sale-item-comment-form__overlay-card h4 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    color: #2d3748;
}
.sale-item-comment-form__overlay-card p {
    margin: 0 0 15px;
    color: #718096;
    font-size: 0.9rem;
}
.sale-item-comment-form__overlay-fields input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 12px;
}
.sale-item-comment-form__overlay-button {
    width: 100%;
    padding: 10px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.sale-item-comment-form__overlay-button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* Comment List */
.sale-item-comment-list {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}
.sale-item-comment-list .children {
    list-style: none;
    margin-left: 20px; /* Indent */
    padding-left: 20px;
    border-left: 2px solid #e2e8f0;
    background: transparent;
}

.sale-item-comment {
    margin-bottom: 20px;
    animation: fadeIn 0.3s;
}
.sale-item-comment.is-newly-added {
    animation: highlightNew 2s ease;
}
.sale-item-comment.is-spotlight {
    animation: highlightSpotlight 2s ease;
    border: 2px solid #f6e05e;
    border-radius: 8px;
    padding: 10px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes highlightNew { 
    0% { background: #ebf8ff; } 
    100% { background: transparent; } 
}
@keyframes highlightSpotlight {
    0%, 50% { background: #fffff0; border-color: #ecc94b; }
    100% { background: transparent; border-color: transparent; }
}

.sale-item-comment__inner {
    background: #fff;
    /* No border per item usually, rely on structure? Theme style override might be needed if theme has borders */
}

.sale-item-comment__meta {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 8px;
}
.sale-item-comment__author {
    font-weight: 800;
    color: #2d3748;
}
.sale-item-comment__badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.sale-item-comment__badge--review { background: #bee3f8; color: #2b6cb0; }
.sale-item-comment__badge--question { background: #feebc8; color: #c05621; }

.sale-item-comment__content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
}

.sale-item-comments__empty.is-hidden,
.sale-item-comments__empty--tab.is-hidden {
    display: none;
}
.sale-item-comments__empty {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}
