/* Container & Header */
.v9-comments-container {
    max-width: 600px;
    margin: 2rem 0;
    font-family: var(--wp--preset--font-family--body, "Roboto", sans-serif);
    color: #000;
}

.dark .v9-comments-container {
    color: #fff;
}

.v9-comments-header h3 {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 0.5rem;
}

.dark .v9-comments-header h3 { border-color: #333; }

/* Input Area Logged In */
.v9-logged-in-box {
    display: flex;
    gap: 12px;
    margin-bottom: 0.5rem;
    align-items: flex-start;
}

/* Avatar Containers - Prevent Squishing */
.v9-user-avatar,
.v9-comment-avatar {
    flex-shrink: 0; 
}

/* Avatar Images - Enforce Perfect Circle */
.v9-user-avatar img,
.v9-comment-avatar img {
    width: 40px;
    height: 40px;
    min-width: 40px; /* Forces it to stay 40px wide */
    min-height: 40px; /* Forces it to stay 40px tall */
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
    display: block; /* Removes native inline-image spacing bugs */
}

.v9-input-wrapper {
    flex-grow: 1;
    display: flex;
    border: 1px solid #eaeaea;
    border-radius: 24px;
    padding: 8px 16px;
    align-items: center;
    background: #fff;
}

.dark .v9-input-wrapper {
    background: #222;
    border-color: #444;
}

.v9-input-wrapper textarea {
    flex-grow: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 14px;
    color: inherit;
    padding: 0;
    margin-right: 10px;
}

.v9-btn-post {
    background: transparent;
    border: none;
    color: #ff0044; /* Matches Val9ja News Accent */
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

.v9-btn-post:disabled {
    color: #a0cbf7;
    cursor: not-allowed;
}

.v9-user-actions {
    display: flex;
    justify-content: space-between;
    margin-left: 52px;
    margin-bottom: 2rem;
    font-size: 12px;
    color: #666;
}

.v9-logout-link {
    color: #f04;
    text-decoration: none;
}

/* Logged Out State */
.v9-logged-out-box {
    text-align: center;
    padding: 2rem;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #eaeaea;
}

.dark .v9-logged-out-box {
    background: #111;
    border-color: #333;
}

.v9-auth-prompt p {
    font-weight: 700;
    margin-bottom: 1rem;
}

#v9-google-btn-container {
    display: flex;
    justify-content: center;
}

/* WhatsApp-Style Chat Window */
.v9-comments-feed {
    display: flex;
    flex-direction: column; /* MUST be column, NOT column-reverse */
    gap: 1.25rem;
    max-height: 500px; /* Forces scrollable container */
    overflow-y: auto;
    padding-right: 10px;
    scroll-behavior: smooth;
}

.v9-comment-item {
    display: flex;
    gap: 12px;
}

.v9-comment-body {
    flex-grow: 1;
}

.v9-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.v9-comment-header strong {
    font-size: 14px;
    font-weight: 700;
}

.v9-comment-date {
    font-size: 12px;
    color: #888;
}

.v9-comment-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.v9-comment-text p {
    margin: 0;
}

.v9-comment-actions {
    display: flex;
    gap: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    align-items: center;
}

.v9-reply-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

/* =======================================
   Instagram-Style Comment Like Button 
   ======================================= */
.v9-comment-like-action {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    margin-left: 10px;
    padding-top: 2px;
}

.v9-comment-like-action .v9-like-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    padding: 4px;
    height: auto;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #888;
}

.dark .v9-comment-like-action .v9-like-btn {
    background: transparent !important;
    color: #aaa;
}

.v9-comment-like-action .v9-like-btn:hover {
    background: transparent !important;
    transform: scale(1.1);
}

.v9-comment-like-action .v9-like-btn.is-liked {
    color: #ff0044 !important;
    background: transparent !important;
}

.v9-comment-like-action .v9-like-btn svg {
    transition: transform 0.2s;
}

.v9-comment-like-action .v9-like-btn:active svg {
    transform: scale(1.3);
}

/* The Like Count Text (Instagram Style) */
.v9-comment-like-count-text {
    font-weight: 700;
    color: #888;
    font-size: 12px;
}
.dark .v9-comment-like-count-text {
    color: #aaa;
}
/* ======================================= */

/* Skeleton Loader */
.v9-skeleton-loader {
    display: flex;
    gap: 12px;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
}

.dark .skeleton-avatar { background: #333; }

.skeleton-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.skeleton-line {
    height: 12px;
    background: #eee;
    border-radius: 4px;
}

.dark .skeleton-line { background: #333; }
.skeleton-line.short { width: 30%; }
.skeleton-line.long { width: 80%; }

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Nested Replies & Shallow Threading */
.v9-comment-node {
    display: flex;
    flex-direction: column;
}

.v9-replies-section {
    margin-left: 52px; /* Aligns precisely under the comment body text */
    margin-top: 5px;
}

.v9-toggle-replies-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: inline-block;
    transition: color 0.2s;
}

.dark .v9-toggle-replies-btn {
    color: #aaa;
}

.v9-toggle-replies-btn:hover {
    color: #555;
}

.dark .v9-toggle-replies-btn:hover {
    color: #ddd;
}

.v9-replies-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Verified Badge */
.v9-verified-icon {
    width: 14px;
    height: 14px;
    fill: #1DA1F2; /* Standard Blue Check Color */
    vertical-align: middle;
    margin-left: 2px;
    margin-top: -2px;
}

/* Pinned State */
.v9-pinned-header {
    color: #000000; /* Val9ja Accent Color */
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.dark .v9-pinned-header { 
    color: #000000; /* Maintains theme color in dark mode */
}

.v9-comment-item.is-pinned {
    background: transparent;
    border: none;
    padding: 0;
}

.dark .v9-comment-item.is-pinned {
    background: transparent;
    border: none;
}

/* Edit & Delete & Pin Buttons */
.v9-action-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}
.v9-action-btn:hover { color: #333; }
.dark .v9-action-btn:hover { color: #fff; }

.v9-delete-btn:hover { color: #f04 !important; }
.v9-edited-tag { font-style: italic; color: #aaa; font-size: 11px; }

/* Inline Editor */
.v9-edit-textarea {
    width: 100%;
    min-height: 60px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
}
.dark .v9-edit-textarea { background: #222; border-color: #444; color: #fff; }

.v9-edit-controls { display: flex; gap: 10px; }
.v9-save-edit-btn { background: #ff0044; color: #fff; border: none; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-size: 12px; font-weight: 600;}
.v9-cancel-edit-btn { background: #eee; color: #333; border: none; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-size: 12px; font-weight: 600;}

/* Profile Modal */
.v9-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none; justify-content: center; align-items: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
}
.v9-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    width: 90%;
    max-width: 300px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.dark .v9-modal-content { background: #1a1a1a; color: #fff; }

.v9-modal-close {
    position: absolute; top: 10px; right: 15px;
    background: transparent; border: none; font-size: 24px;
    cursor: pointer; color: #888;
}
.v9-modal-avatar {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    margin-bottom: 15px; border: 3px solid #ff0044;
}
.v9-modal-name { margin: 0 0 5px 0; font-size: 18px; font-weight: 800; }
.v9-modal-desc { font-size: 13px; color: #666; margin-bottom: 20px; }
.v9-social-placeholder {
    display: inline-block; padding: 8px 16px; background: #f0f0f0;
    border-radius: 20px; font-size: 12px; font-weight: 700; color: #333;
}
.dark .v9-social-placeholder { background: #333; color: #fff; }
.v9-clickable-avatar { cursor: pointer; transition: opacity 0.2s; }
.v9-clickable-avatar:hover { opacity: 0.8; }

/* Dynamic Profile Modal Additions */
.v9-profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.v9-profile-link:hover {
    color: #ff0044; /* Val9ja Accent */
}

.v9-rank-badge {
    background: #f4f6f8;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 15px;
    line-height: 1.4;
    border: 1px solid #eaeaea;
}
.dark .v9-rank-badge {
    background: #222;
    border-color: #333;
}
.v9-rank-badge strong {
    color: #ff0044;
    font-size: 14px;
}

.v9-modal-socials {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.v9-social-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    background: #eee;
    padding: 6px 14px;
    border-radius: 20px;
    transition: background 0.2s;
}
.dark .v9-social-icon { background: #333; color: #ddd; }
.v9-social-icon:hover { background: #e0e0e0; }

.v9-modal-bio {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 15px 0;
    padding: 0 15px;
    font-style: italic;
}
.dark .v9-modal-bio { color: #ccc; }

.v9-btn-view-profile {
    display: block;
    background: #ff0044;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 0;
    border-radius: 24px;
    transition: background 0.2s;
}
.v9-btn-view-profile:hover {
    background: #106ecb;
}

/* Profile Modal Action Buttons & Inputs */
.v9-action-btn {
    background: #f0f2f5;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 5px;
    transition: background 0.2s;
}
.v9-action-btn:hover {
    background: #e4e6eb;
}

/* Unique Pin Button Style */
.v9-pin-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 12px; /* Ensures it matches the size of the Reply button */
}

/* Optional hover effect for the pin button so it reacts like the Reply button */
.v9-pin-btn:hover {
    color: #333;
}
.dark .v9-pin-btn:hover {
    color: #fff;
}

/* Avatar Update Input */
#v9-avatar-url-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

/* Notification Toggle Setting */
.v9-toggle-setting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    margin-top: 15px;
    cursor: pointer;
}

/* Message Box */
#v9-message-box {
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px !important;
}
#v9-message-text {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-family: inherit;
}

/* Styling for message attachment group */
.v9-message-attach-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

#v9-image-preview img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

/* Custom Scrollbar for the feed */
.v9-comments-feed::-webkit-scrollbar { width: 6px; }
.v9-comments-feed::-webkit-scrollbar-track { background: transparent; }
.v9-comments-feed::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.dark .v9-comments-feed::-webkit-scrollbar-thumb { background: #444; }

/* Emoji Toggle Button */
.v9-emoji-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 8px 0 0;
    display: flex;
    align-items: center;
}
.v9-emoji-trigger:hover svg { fill: #ff0044; }

/* Floating Emoji Picker Popups */
#v9-main-picker-container,
#v9-modal-picker-container {
    display: none;
    position: absolute;
    bottom: 100%; /* Positions it directly above the input */
    left: 50%; /* Centers the start position */
    transform: translateX(-50%); /* Pulls it back perfectly to the center */
    z-index: 10000;
    margin-bottom: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    background: #fff;
}
.dark #v9-main-picker-container,
.dark #v9-modal-picker-container { background: #222; }

/* Show pickers when active */
#v9-main-picker-container.active,
#v9-modal-picker-container.active {
    display: block;
}

#v9-comment-textarea {
    resize: none;
}