/* sawtak-comments-unified.css - Unified comments and replies styles for Sawtak and Profile pages */

/* ── Comments Section ── */
.comments-section {
    padding: 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.12);
}

/* ── Add Comment Row ── */
.add-comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

/* avatar — both legacy (.current-user-avatar) and PostCard (.comment-author-pic) */
.add-comment .current-user-avatar,
.add-comment .comment-author-pic {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.12);
    object-fit: cover;
    margin-top: 4px;
    flex-shrink: 0;
}

/* ── Comment Input Container ──
   Targets both the old .post-input-container.comment-input-container
   and the plain .comment-input-container used in PostCard HTML            */
.post-input-container.comment-input-container,
.add-comment .comment-input-container {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 4px 6px 4px 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.post-input-container.comment-input-container:focus-within,
.add-comment .comment-input-container:focus-within {
    border-color: rgba(0,210,255,0.35);
    box-shadow: 0 0 14px rgba(0,210,255,0.08);
}

/* ── Textarea Wrapper (legacy input-handler HTML) ── */
.textarea-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    min-height: 42px;
}

/* ── Comment text input ── */
.comment-input {
    flex: 1;
    min-width: 0;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    padding: 6px 0 !important;
    font-family: inherit;
    background-color: transparent !important;
}

.comment-input::placeholder { color: rgba(255,255,255,0.28); }

/* ── Input Action Button Row ──
   Targets .input-actions-right, the legacy .comment-input-actions,
   and the PostCard .comment-input-actions                                  */
.input-actions-right,
.input-actions-container.comment-input-actions,
.add-comment .comment-input-actions {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
}

/* Icon buttons: .post-action-icon (legacy) and .comment-action-icon (PostCard) */
.post-action-icon,
.comment-action-icon {
    background: none;
    border: none;
    color: rgba(255,255,255,0.32);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.post-action-icon:hover,
.comment-action-icon:hover {
    color: var(--accent, #00d2ff);
    background: rgba(0,210,255,0.1);
}

/* Primary / send button: .primary-action-btn (legacy) and .post-comment-btn (PostCard) */
.primary-action-btn,
.post-comment-btn {
    background: linear-gradient(135deg, #00d2ff 0%, #7b2ff7 100%);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.82rem;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,210,255,0.25);
    padding: 0;
}

.primary-action-btn:hover,
.post-comment-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(0,210,255,0.4);
}

/* Mic button: slightly different gradient to distinguish it */
.post-comment-btn.mic,
.post-comment-btn.primary-action {
    background: linear-gradient(135deg, #7b2ff7 0%, #00d2ff 100%);
}

/* ── Attachment Options ── */
.attachment-options-modal {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.08);
}

.attachment-options-modal.hidden { display: none; }

/* ── Recording UI ── */
.recording-ui-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.recording-ui-container.hidden { display: none; }

.recording-waveform {
    flex: 1;
    height: 26px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    overflow: hidden;
}

.recording-timer {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff3366;
    font-variant-numeric: tabular-nums;
    min-width: 34px;
}

/* ── Audio Preview ── */
.audio-preview-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}

.audio-preview-container.hidden { display: none; }

.play-pause-btn {
    background: rgba(0,210,255,0.14);
    border: 1px solid rgba(0,210,255,0.28);
    color: #00d2ff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.play-pause-btn:hover { background: rgba(0,210,255,0.24); }

.time-display {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.45);
    font-variant-numeric: tabular-nums;
}

/* ── Image Preview ── */
.image-preview-container { padding: 8px 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.image-preview-container.hidden { display: none; }

/* ── Comments List ── */
.comments-list { margin-top: 4px; }

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.comment-pic {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.1);
    margin-top: 2px;
}

.comment-content {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.05) !important;
    border-radius: 14px;
    padding: 8px 12px;
}

.comment-user {
    font-weight: 700;
    font-size: 0.84rem;
    color: #fff;
    cursor: pointer;
    margin-bottom: 2px;
}

.comment-user:hover { color: var(--accent, #00d2ff); }

.comment-text {
    font-size: 0.87rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    word-break: break-word;
}

.comment-time {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.28);
    margin-top: 4px;
}

.comment-actions { display: flex; gap: 8px; margin-top: 4px; }

.comment-action-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.32);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.comment-action-btn:hover { color: #fff; }

/* ── Reply Indentation ── */
.reply-section { margin-top: 8px; padding-right: 38px; }
.reply { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
.reply-user-pic { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; object-fit: cover; margin-top: 2px; }
.reply-content { flex: 1; min-width: 0; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 6px 10px; }
.reply-user { font-size: 0.8rem; font-weight: 700; color: var(--accent, #00d2ff); margin-bottom: 2px; }
.reply-text { font-size: 0.82rem; color: rgba(255,255,255,0.78); line-height: 1.4; word-break: break-word; }
.reply-time { font-size: 0.68rem; color: rgba(255,255,255,0.25); margin-top: 3px; }

/* ── Rating Stars Input ── */
.rating-star-input { font-size: 22px; color: rgba(255,255,255,0.18); cursor: pointer; transition: color 0.2s; }
.rating-star-input:hover, .rating-star-input.active { color: #ffcc00; }
.rating-value-display { font-size: 1rem; font-weight: 800; color: #ffcc00; background: rgba(255,204,0,0.1); padding: 3px 12px; border-radius: 99px; border: 1px solid rgba(255,204,0,0.2); }

/* ── Mobile: Tighter sizing for phones ── */
@media (max-width: 768px) {
    /* Comments section */
    .comments-section {
        padding: 10px 8px !important;
    }
    .add-comment {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }
    .add-comment .current-user-avatar,
    .add-comment .comment-author-pic {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }
    .textarea-wrapper {
        padding: 5px 8px !important;
        min-height: 34px !important;
    }
    .comment-input {
        font-size: 0.78rem !important;
    }
    .post-action-icon,
    .comment-action-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.78rem !important;
    }
    .primary-action-btn,
    .post-comment-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.72rem !important;
    }

    /* Comment items */
    .comment {
        gap: 7px !important;
        margin-bottom: 9px !important;
    }
    .comment-pic {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
    }
    .comment-content {
        padding: 6px 10px !important;
        border-radius: 11px !important;
    }
    .comment-user {
        font-size: 0.76rem !important;
    }
    .comment-text {
        font-size: 0.78rem !important;
    }
    .comment-time {
        font-size: 0.65rem !important;
    }
    .comment-action-btn {
        font-size: 0.68rem !important;
    }

    /* Reply items */
    .reply-section {
        padding-right: 28px !important;
    }
    .reply-user-pic {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
    }
    .reply-content {
        padding: 5px 8px !important;
        border-radius: 10px !important;
    }
    .reply-user { font-size: 0.72rem !important; }
    .reply-text { font-size: 0.74rem !important; }
    .reply-time { font-size: 0.62rem !important; }

    /* Rating stars input in publish modal */
    .rating-star-input {
        font-size: 3vw !important;
    }
    .rating-stars-input {
        gap: 4px !important;
        justify-content: center !important;
    }
    .rating-value-display {
        font-size: 0.82rem !important;
        padding: 2px 8px !important;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .comment-pic { width: 22px !important; height: 22px !important; min-width: 22px !important; }
    .comment-user { font-size: 0.7rem !important; }
    .comment-text { font-size: 0.72rem !important; }
}
