
/* =========================================================
   SAMACHAR TODAY - COMMENTS EXTENSION
   ========================================================= */

.st-comments,
.st-comments * {
    box-sizing: border-box;
}

.st-comments {
    --st-primary: #0b57d0;
    --st-primary-dark: #0846a8;
    --st-text: #172033;
    --st-muted: #64748b;
    --st-border: #e2e8f0;
    --st-bg: #ffffff;
    --st-soft: #f8fafc;
    --st-success: #15803d;
    --st-danger: #dc2626;

    width: 100%;
    max-width: 100%;
    margin: 30px 0 10px;
    padding: 24px;
    background: var(--st-bg);
    border: 1px solid var(--st-border);
    border-radius: 12px;
    color: var(--st-text);
    font-family: inherit;
    overflow-wrap: anywhere;
}

/* Header */

.st-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--st-border);
}

.st-comments-title {
    margin: 0 0 5px;
    font-size: 23px;
    line-height: 1.35;
    font-weight: 800;
    color: var(--st-text);
    text-align: left;
}

.st-comments-subtitle {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--st-muted);
    text-align: left;
}

.st-comments-total {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 30px;
    background: #eff6ff;
    color: var(--st-primary);
    font-size: 12px;
    font-weight: 700;
}

.st-comments-total-number {
    font-size: 15px;
}

/* Notice */

.st-comments-notice {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}

.st-comments-notice[hidden] {
    display: none !important;
}

.st-comments-notice.is-success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.st-comments-notice.is-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.st-comments-notice.is-info {
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* Form card */

.st-comment-form-card {
    margin: 20px 0 28px;
    padding: 20px;
    background: var(--st-soft);
    border: 1px solid var(--st-border);
    border-radius: 10px;
}

.st-comment-form-heading {
    margin: 0 0 18px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 750;
    color: var(--st-text);
    text-align: left;
}

.st-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.st-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 15px;
    min-width: 0;
}

.st-form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--st-text);
    text-align: left;
}

.st-form-group input,
.st-form-group textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: var(--st-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s;
}

.st-form-group input:focus,
.st-form-group textarea:focus {
    border-color: var(--st-primary);
    box-shadow: 0 0 0 3px rgba(11, 87, 208, .10);
}

.st-form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.st-form-group input::placeholder,
.st-form-group textarea::placeholder {
    color: #94a3b8;
}

.st-form-group small {
    color: var(--st-muted);
    font-size: 11px;
    line-height: 1.5;
}

.st-comment-character-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--st-muted);
    font-size: 11px;
}

.st-comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.st-comment-form-footer p {
    margin: 0;
    color: var(--st-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
}

.st-submit-comment,
.st-load-more {
    border: 0;
    border-radius: 7px;
    padding: 11px 18px;
    background: var(--st-primary);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.st-submit-comment:hover,
.st-load-more:hover {
    background: var(--st-primary-dark);
}

.st-submit-comment:active,
.st-load-more:active {
    transform: translateY(1px);
}

.st-submit-comment:disabled,
.st-load-more:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Reply context */

.st-replying-to {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 15px;
    padding: 10px 12px;
    background: #eff6ff;
    border-radius: 7px;
    color: #1e40af;
    font-size: 12px;
}

.st-replying-to[hidden] {
    display: none !important;
}

.st-cancel-reply {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* List heading */

.st-comments-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.st-comments-list-heading h3 {
    margin: 0;
    color: var(--st-text);
    font-size: 17px;
    font-weight: 800;
    text-align: left;
}

.st-comments-list-heading span {
    color: var(--st-muted);
    font-size: 12px;
}

/* Comment card */

.st-comment-card {
    padding: 17px 0;
    border-bottom: 1px solid var(--st-border);
}

.st-comment-card:first-child {
    padding-top: 4px;
}

.st-comment-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.st-comment-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0edff;
    color: var(--st-primary);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.st-comment-content {
    flex: 1;
    min-width: 0;
}

.st-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 7px;
}

.st-comment-author {
    color: var(--st-text);
    font-size: 13px;
    font-weight: 800;
}

.st-comment-date {
    color: var(--st-muted);
    font-size: 11px;
}

.st-comment-text {
    margin: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.st-comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 11px 0 0 50px;
}

.st-comment-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--st-muted);
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.st-comment-action:hover {
    color: var(--st-primary);
}

.st-comment-action.is-liked {
    color: var(--st-primary);
}

.st-comment-action:disabled {
    opacity: .5;
    cursor: wait;
}

.st-comment-action-report:hover {
    color: var(--st-danger);
}

/* Replies */

.st-replies {
    margin: 14px 0 0 50px;
    padding-left: 15px;
    border-left: 2px solid #dbeafe;
}

.st-replies[hidden] {
    display: none !important;
}

.st-reply-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
}

.st-reply-card:last-child {
    border-bottom: 0;
}

.st-reply-card .st-comment-avatar {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.st-reply-card .st-comment-actions {
    margin-left: 40px;
}

.st-replies-toggle {
    color: var(--st-primary);
}

.st-replies-loading,
.st-replies-empty {
    padding: 10px 0;
    color: var(--st-muted);
    font-size: 12px;
}

/* Report control */

.st-report-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0 0 50px;
    padding: 10px;
    background: var(--st-soft);
    border: 1px solid var(--st-border);
    border-radius: 7px;
}

.st-report-box[hidden] {
    display: none !important;
}

.st-report-box select {
    min-width: 0;
    max-width: 220px;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: var(--st-text);
    font: inherit;
    font-size: 11px;
}

.st-report-submit,
.st-report-cancel {
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.st-report-submit {
    background: var(--st-danger);
    color: #fff;
}

.st-report-cancel {
    background: #e2e8f0;
    color: #334155;
}

/* Loading */

.st-comments-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 10px;
    color: var(--st-muted);
    font-size: 12px;
}

.st-comments-loading[hidden] {
    display: none !important;
}

.st-comments-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbeafe;
    border-top-color: var(--st-primary);
    border-radius: 50%;
    animation: st-comment-spin .7s linear infinite;
}

@keyframes st-comment-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */

.st-comments-empty {
    padding: 25px 12px;
    text-align: center;
    color: var(--st-muted);
}

.st-comments-empty[hidden] {
    display: none !important;
}

.st-comments-empty-icon {
    margin-bottom: 8px;
    font-size: 30px;
}

.st-comments-empty strong {
    display: block;
    color: var(--st-text);
    font-size: 14px;
}

.st-comments-empty p {
    margin: 6px 0 0;
    font-size: 12px;
}

/* Pagination */

.st-comments-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.st-load-more[hidden] {
    display: none !important;
}

.st-load-more {
    background: #eff6ff;
    color: var(--st-primary);
    border: 1px solid #bfdbfe;
}

.st-load-more:hover {
    background: #dbeafe;
}

/* Tablet */

@media (max-width: 767px) {
    .st-comments {
        margin-top: 22px;
        padding: 17px 13px;
        border-radius: 10px;
    }

    .st-comments-title {
        font-size: 20px;
    }

    .st-comment-form-card {
        padding: 15px 12px;
    }

    .st-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Mobile */

@media (max-width: 480px) {
    .st-comments-header {
        align-items: flex-start;
        gap: 8px;
    }

    .st-comments-total {
        padding: 6px 9px;
        font-size: 10px;
    }

    .st-comments-total-number {
        font-size: 13px;
    }

    .st-comments-subtitle {
        font-size: 11px;
    }

    .st-comment-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .st-submit-comment {
        width: 100%;
    }

    .st-comment-main {
        gap: 9px;
    }

    .st-comment-avatar {
        flex-basis: 33px;
        width: 33px;
        height: 33px;
    }

    .st-comment-actions {
        margin-left: 42px;
        gap: 12px;
    }

    .st-replies {
        margin-left: 40px;
        padding-left: 10px;
    }

    .st-report-box {
        margin-left: 40px;
    }

    .st-comment-date {
        font-size: 10px;
    }

    .st-comment-text {
        font-size: 12px;
    }
}
