/**
 * Slowtwitch Dashboard & Author Profile Styles
 *
 * Shared styles for:
 *   - Role tabs (As Buyer / As Seller) used by chat + reviews
 *   - Reviews dashboard tab
 *   - Author profile reviews section
 */

/* ─── Role Tabs (shared by chat + reviews) ──────────────────────────────── */

.st-chat-role-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.st-chat-role-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #777;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.st-chat-role-tab:hover {
    color: #333;
}

.st-chat-role-tab--active {
    color: #333;
    border-bottom-color: #2962ff;
    font-weight: 600;
}

.st-chat-role-count {
    background: #eee;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 12px;
    margin-left: 6px;
}

.st-chat-role-tab--active .st-chat-role-count {
    background: #2962ff;
    color: #fff;
}

.st-chat-role-panel {
    display: none;
}

.st-chat-role-panel--active {
    display: block;
}

/* ─── Reviews Dashboard Tab ─────────────────────────────────────────────── */

.st-reviews-section {
    margin-bottom: 30px;
}

.st-reviews-section__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.st-reviews-section__desc {
    font-size: 13px;
    color: #777;
    margin: 0 0 16px 0;
}

.st-reviews-section__empty {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

.st-review-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.st-review-card--pending {
    background: #fafafa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

.st-review-card__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.st-review-card__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.st-review-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

a.st-review-card__seller {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    max-width: fit-content;
}

a.st-review-card__seller:hover {
    text-decoration: underline;
}

.st-review-card__listing {
    font-size: 13px;
    color: #666;
    text-decoration: none;
}

.st-review-card__listing:hover {
    text-decoration: underline;
}

.st-review-card__stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.st-review-card__stars i {
    font-size: 12px;
    color: #ffb100;
}

.st-review-card__stars i.far {
    color: #ddd;
}

.st-review-card__date {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.st-review-card__content {
    padding: 0 0 12px 52px;
}

.st-review-card__content p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.st-reviews-aggregate {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: #fafafa;
    border-radius: 6px;
}

.st-reviews-aggregate__avg {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.st-reviews-aggregate__stars i {
    font-size: 16px;
    color: #ffb100;
}

.st-reviews-aggregate__stars i.far {
    color: #ddd;
}

.st-reviews-aggregate__count {
    font-size: 14px;
    color: #777;
}

/* ─── Inline Review Form (dashboard) ────────────────────────────────────── */

.st-dash-review-form {
    padding: 0 0 16px 0;
    margin-bottom: 8px;
}

.st-dash-review-form__inner {
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 16px;
}

.st-dash-review-form__group {
    margin-bottom: 12px;
}

.st-dash-review-form__group label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
    color: #333;
}

.st-dash-review-form__group label .required {
    color: #e74c3c;
}

.st-dash-review-form__group textarea {
    width: 100%;
    resize: vertical;
}

.st-dash-review-form__group .directorist-btn {
    margin-right: 8px;
}

.st-dash-star-input {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
}

.st-dash-star-input i {
    font-size: 22px;
    color: #ddd;
    transition: color 0.15s;
}

.st-dash-star-input i.fas,
.st-dash-star-input i.hovered {
    color: #ffb100;
}

.st-dash-review-form__alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

.st-dash-review-form__alert--error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #c0392b;
}

.st-dash-review-form__alert--success {
    background: #f0fef0;
    border: 1px solid #c6f5c6;
    color: #27ae60;
}

/* ─── Author Profile Reviews ────────────────────────────────────────────── */

.st-author-reviews {
    margin-top: 30px;
    margin-bottom: 80px;
}

.st-author-reviews__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.st-author-reviews__aggregate {
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-author-reviews__avg {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.st-author-reviews__stars i {
    font-size: 14px;
    color: #ffb100;
}

.st-author-reviews__stars i.far {
    color: #ddd;
}

.st-author-reviews__empty {
    color: #777;
    font-style: italic;
    margin: 0;
}

.st-author-reviews__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.st-author-reviews__item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.st-author-reviews__item:last-child {
    border-bottom: none;
}

.st-author-reviews__item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.st-author-reviews__reviewer-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.st-author-reviews__reviewer-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

a.st-author-reviews__reviewer-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

a.st-author-reviews__reviewer-name:hover {
    text-decoration: underline;
}

.st-author-reviews__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #999;
}

.st-author-reviews__type {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.st-author-reviews__type--seller {
    background: #e8f5e9;
    color: #2e7d32;
}

.st-author-reviews__type--listing {
    background: #e3f2fd;
    color: #1565c0;
}

.st-author-reviews__listing-link {
    color: #666;
    text-decoration: none;
    font-size: 12px;
}

.st-author-reviews__listing-link:hover {
    text-decoration: underline;
}

.st-author-reviews__item-rating i {
    color: #ffb100;
    font-size: 13px;
}

.st-author-reviews__item-rating i.far {
    color: #ddd;
}

.st-author-reviews__item-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding-left: 52px;
}

.st-author-reviews__item-content p {
    margin: 0;
}

/* ─── Buyer Chat Form: Mirror #ChatForm styles ───────────────────────────── */

#ChatForm-buyer {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ChatForm-buyer input[name="chatMsg"] {
    background: #F4F5F7;
    border: 0 none;
    border-radius: 35px;
    height: 60px;
    flex: 1;
    padding: 0 30px;
    resize: none;
    color: #444752;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ChatForm-buyer input[name="chatMsg"]::placeholder {
    color: #9299B8;
    font-size: 14px;
    font-weight: 400;
}

#ChatForm-buyer button[type="submit"] {
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    background-color: var(--directorist-color-primary, #444752);
    filter: drop-shadow(0 8px 13px rgba(68, 71, 82, .20));
    color: #fff;
    border: 0 none;
    font-size: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
}

#ChatForm-buyer button[type="submit"]:hover {
    opacity: 0.85;
}

.directorist-message-list #ChatForm-buyer button .directorist-icon-mask:after {
    background: #FFFFFF;
    width: 25px;
    height: 25px;
    transform: rotate(-35deg);
}

@media (max-width: 600px) {
    #ChatForm-buyer { flex-direction: column; }
    #ChatForm-buyer input[name="chatMsg"] { flex: auto; height: 45px; }
    #ChatForm-buyer button[type="submit"] { width: 40px; height: 40px; }
    .directorist-message-list #ChatForm-buyer button .directorist-icon-mask:after { width: 20px; height: 20px; }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

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

    .st-review-card__content {
        padding-left: 0;
    }

    .st-author-reviews__item-header {
        flex-wrap: wrap;
    }

    .st-author-reviews__item-content {
        padding-left: 0;
    }
}

/* ─── Listing ────────────────────────────────────────────────────────── */

.directorist-table-responsive {
    @media (min-width: 1200px) {
        min-height: 415px;
    }
}