/* =========================================
   SECURITY & ACCESSIBILITY
   ========================================= */
.ccp-hp-wrapper {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

li[id^="comment-"], 
div[id^="comment-"],
#respond {
    scroll-margin-top: calc(var(--header-h) + 24px) !important;
}

/* =========================================
   MODERN FORM UI & SPACING
   ========================================= */
.ccp-modern-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #0f172a;
}

.comment-respond .logged-in-as {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 18px;
}
.comment-respond .logged-in-as a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.comment-respond .logged-in-as a:hover {
    text-decoration: underline;
}

.ccp-editor-container {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.ccp-editor-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ccp-editor-container .mce-toolbar-grp {
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}
.ccp-editor-container .mce-statusbar {
    display: none !important; 
}

.ccp-edit-wrapper { 
    margin-top: 10px; 
}

.form-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.wp-block-post-comments-form form input[type="submit"],
.ccp-modern-submit-btn {
    background: #2563eb !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 32px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25) !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
}

.wp-block-post-comments-form form input[type="submit"]:hover,
.ccp-modern-submit-btn:hover {
    background: #1d4ed8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35) !important;
}

/* =========================================
   EDIT / DELETE CONTROLS
   ========================================= */
.ccp-controls-wrapper {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.ccp-edit-btn, .ccp-save-btn, .ccp-cancel-btn, .ccp-delete-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 16px;
    border-radius: 20px; 
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ccp-edit-btn:hover, .ccp-cancel-btn:hover { 
    background: #e2e8f0; 
    color: #1e293b; 
}

.ccp-save-btn { background: #10b981; color: #fff; border-color: #059669; }
.ccp-save-btn:hover { background: #059669; }
.ccp-delete-btn { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.ccp-delete-btn:hover { background: #fee2e2; color: #b91c1c; }

/* =========================================
   MODERN CHAT-STYLE REPLIES
   ========================================= */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .comment-body {
    max-width: 80%;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    background: #fff;
    clear: both;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

.ccp-chat-mine > .comment-body {
    margin-left: auto;
    margin-right: 0;
    background-color: #eff6ff; 
    border-bottom-right-radius: 4px; 
    border-color: #bfdbfe;
}

.ccp-chat-other > .comment-body {
    margin-right: auto;
    margin-left: 0;
    background-color: #f8fafc; 
    border-bottom-left-radius: 4px;
    border-color: #e2e8f0;
}

/* =========================================
   META DETAILS (AVATAR, NAME, DATE)
   ========================================= */
.comment-list .comment-meta,
.comment-list footer.comment-meta,
.comment-list header.comment-meta {
    font-size: 0.85em !important;
    color: #64748b !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(0,0,0,0.06) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.comment-list .comment-author,
.comment-list .comment-metadata,
.comment-list .comment-author .fn,
.comment-list .comment-author b,
.comment-list .comment-metadata a,
.comment-list .comment-metadata time {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1 !important;
}

.comment-list .comment-meta .says { display: none !important; }

.comment-list .comment-metadata::before {
    content: "•" !important;
    color: #cbd5e1 !important;
    margin-right: 2px !important;
    display: inline-block !important;
}

.comment-list .comment-meta img.avatar {
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    margin: 0 !important;
    display: inline-block !important;
}

.comment-list .ccp-chat-mine > .comment-body .comment-meta,
.comment-list .ccp-chat-mine > .comment-body .comment-author { 
    flex-direction: row-reverse !important; 
}

.comment-list .ccp-chat-mine > .comment-body .comment-metadata::before {
    display: none !important;
}
.comment-list .ccp-chat-mine > .comment-body .comment-metadata::after {
    content: "•" !important;
    color: #cbd5e1 !important;
    margin-left: 8px !important;
    display: inline-block !important;
}

/* =========================================
   BLOCK THEME GAP FIX
   ========================================= */
div.wp-block-group:has(> .wp-block-post-comments-form),
.wp-block-post-comments-form {
    margin-top: 15px !important; 
    padding-top: 0 !important;
}

#respond small {
    display: block;
    margin-bottom: 5px;
}

/* =========================================
   FLOATING COMMENT BUTTON (BOTTOM LEFT)
   ========================================= */
#ccp-comment-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: #2271b1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2147483645;
    cursor: pointer;
    transition: all 0.3s ease;
}

#ccp-comment-fab:hover {
    background-color: #135e96;
    transform: scale(1.08);
}
#ccp-comment-fab svg { width: 22px; height: 22px; }

/* =========================================
   COMMENT SORTING UI
   ========================================= */
.ccp-comment-sort {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    font-size: 14px;
    color: #475569;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.ccp-comment-sort select {
    padding: 6px 30px 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23475569%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px auto;
    transition: all 0.2s ease;
}

.ccp-comment-sort select:hover,
.ccp-comment-sort select:focus {
    border-color: #cbd5e1;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}