/**
 * @file
 * Styles for brand social features (like, comment, repost).
 */

/* ===================================
   Social Action Bar
   =================================== */

.brand-social-action-bar {
    border-top: 1px solid #e0e0e0;
    padding: 8px 0 0;
    margin-top: 12px;
}

/* Stats Row */
.social-stats-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 12px 8px;
    font-size: 13px;
    color: #666;
}

.social-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.social-stat i {
    font-size: 14px;
    color: #0a66c2;
}

.social-stat:hover {
    color: #0a66c2;
    cursor: pointer;
    text-decoration: underline;
}

/* Action Buttons */
.social-action-buttons {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e0e0e0;
    padding: 4px 0;
}

.social-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.social-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: #333;
}

.social-action-btn i {
    font-size: 18px;
}

.social-action-btn.active {
    color: #0a66c2;
}

.social-action-btn.active i {
    color: #0a66c2;
}

.social-action-btn.processing {
    opacity: 0.7;
    pointer-events: none;
}

/* Reaction emoji display */
.reaction-emoji {
    font-size: 18px;
    margin-right: 2px;
}

/* Reaction Picker */
.reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-bottom: 8px;
}

.reaction-option {
    background: none;
    border: none;
    font-size: 24px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.reaction-option:hover {
    transform: scale(1.3);
    background-color: rgba(0, 0, 0, 0.05);
}

/* Position social buttons container relatively */
.social-action-buttons {
    position: relative;
}

/* ===================================
   Comments Section
   =================================== */

.brand-comments-section {
    border-top: 1px solid #e0e0e0;
    padding: 12px;
    background: #f9f9f9;
}

.comments-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.comments-loading i {
    margin-right: 8px;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.brand-comment-item {
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.brand-comment-item:last-child {
    border-bottom: none;
}

/* Brand reply styling */
.brand-comment-item.brand-reply {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin: 4px 0;
}

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

.comment-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author-avatar.brand-avatar {
    border-radius: 4px;
}

.brand-avatar-placeholder {
    width: 36px;
    height: 36px;
    background: #0a66c2;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.comment-author-info {
    flex: 1;
}

.comment-author-name {
    display: block;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.comment-author-name:hover {
    color: #0a66c2;
    text-decoration: underline;
}

.comment-author-name.brand-name {
    color: #0a66c2;
}

.brand-badge {
    margin-left: 4px;
    color: #0a66c2;
    font-size: 12px;
}

.comment-time {
    font-size: 12px;
    color: #666;
}

.comment-content {
    padding-left: 46px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* @mention highlighting */
.comment-content .mention,
.comment-content a[href*="/user/"] {
    color: #0a66c2;
    font-weight: 600;
    text-decoration: none;
}

.comment-content .mention:hover,
.comment-content a[href*="/user/"]:hover {
    text-decoration: underline;
}

/* Comment actions (reply button) */
.comment-actions {
    padding-left: 46px;
    margin-top: 8px;
}

.comment-reply-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-reply-btn:hover {
    background: #f0f0f0;
    color: #0a66c2;
}

.comment-reply-btn i {
    margin-right: 4px;
}

/* Threaded comment structure */
.comment-main {
    position: relative;
}

.nested-comment {
    margin-left: 32px;
    padding-left: 16px;
    position: relative;
}

.nested-comment .comment-thread-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.comment-replies {
    margin-top: 8px;
}

.nested-comment.depth-1 {
    margin-left: 32px;
}

.nested-comment.depth-2 {
    margin-left: 24px;
}

.nested-comment.depth-3 {
    margin-left: 16px;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 16px;
    font-style: italic;
}

/* Comment Form */
.comment-form-wrapper {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.brand-comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Reply as Brand option */
.reply-as-brand-option {
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #d0e3f5;
}

.reply-as-brand-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}

.reply-as-brand-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0a66c2;
}

.reply-as-brand-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-as-brand-text i {
    color: #0a66c2;
}

.reply-as-brand-text strong {
    color: #0a66c2;
}

/* Comment Form Layout */
.comment-input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.comment-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-input-wrapper:focus-within {
    border-color: #0a66c2;
    box-shadow: 0 0 0 1px #0a66c2;
}

.comment-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    padding: 4px 0;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
    background: transparent;
}

.comment-input::placeholder {
    color: #888;
}

/* Circular Send Button */
.comment-submit-btn {
    width: 40px;
    height: 40px;
    background: #0a66c2;
    /* Blue background */
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: flex;
    /* Flex to center icon */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.comment-submit-btn:hover {
    background: #004182;
    transform: scale(1.05);
}

.comment-submit-btn:active {
    transform: scale(0.95);
}

.comment-submit-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.comment-submit-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    margin-left: -2px;
    /* Visual optical adjustment */
}

/* Login Prompt */
.comment-login-prompt {
    text-align: center;
    padding: 16px;
    color: #666;
}

.comment-login-prompt a {
    color: #0a66c2;
    text-decoration: none;
    font-weight: 600;
}

.comment-login-prompt a:hover {
    text-decoration: underline;
}

/* Load More */
.load-more-comments {
    text-align: center;
    padding: 8px 0;
}

.load-more-btn {
    background: none;
    border: none;
    color: #0a66c2;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.15s ease;
}

.load-more-btn:hover {
    color: #004182;
    text-decoration: underline;
}

.load-more-btn:disabled {
    color: #999;
    cursor: default;
    text-decoration: none;
}

/* ===================================
   @Mention Autocomplete Dropdown
   =================================== */

.mention-autocomplete-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-bottom: 4px;
}

.mention-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    gap: 10px;
    transition: background-color 0.15s ease;
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.selected {
    background: #f5f5f5;
}

.mention-autocomplete-item .mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mention-autocomplete-item .mention-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
}

.mention-autocomplete-item .hashtag-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a66c2;
    flex-shrink: 0;
    font-size: 16px;
}

.mention-autocomplete-item .mention-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mention-autocomplete-item .mention-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-autocomplete-item .mention-username {
    color: #666;
    font-size: 12px;
}

.mention-autocomplete-item .mention-count {
    color: #999;
    font-size: 12px;
}

/* Styled @mentions and #hashtags in comment text */
.comment-content .post-mention,
.comment-content a.post-mention {
    color: #0a66c2;
    font-weight: 600;
    text-decoration: none;
}

.comment-content .post-mention:hover {
    text-decoration: underline;
}

.comment-content .post-hashtag,
.comment-content a.post-hashtag {
    color: #0a66c2;
    font-weight: 500;
    text-decoration: none;
}

.comment-content .post-hashtag:hover {
    text-decoration: underline;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 576px) {
    .social-action-btn span {
        display: none;
    }

    .social-action-btn i {
        font-size: 20px;
    }

    .social-action-btn {
        padding: 12px;
    }
}