/* ================================================================
   Wed Community — Single Conversation View
================================================================ */
#wcs-app *, #wcs-app *::before, #wcs-app *::after { box-sizing: border-box; }
#wcs-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px; color: #1a1a2e; line-height: 1.5;
}

#wcs-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; align-items: center; justify-content: center; }
#wcs-overlay.active { display: flex !important; }
.wcs-spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.3); border-top-color: #FFD700; border-radius: 50%; animation: wcs-spin .7s linear infinite; }
@keyframes wcs-spin { to { transform: rotate(360deg); } }

#wcs-toast-wrap { position: fixed; top: 28px; right: 28px; z-index: 9100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.wcs-toast { padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,.2); min-width: 200px; animation: wcs-ti .3s ease; }
.wcs-toast.success { background: #10b981; }
.wcs-toast.error   { background: #ef4444; }
@keyframes wcs-ti { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Layout */
.wcs-wrap { max-width: 100%; margin: 0 auto; padding: 20px 16px 60px; }

/* Breadcrumb */
.wcs-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9ca3af; margin-bottom: 20px; flex-wrap: wrap; }
.wcs-breadcrumb a { color: #FFD700 !important; text-decoration: none !important; }
.wcs-breadcrumb a:hover { text-decoration: underline !important; }
.wcs-breadcrumb .sep { color: #d1d5db; }

/* Main card */
.wcs-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin-bottom: 24px; }

/* Author row */
.wcs-author-row { display: flex !important; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.wcs-avatar { width: 55px; height: 55px; object-fit: cover; flex-shrink: 0; }
.wcs-avatar-ph { display: inline-flex !important; align-items: center; justify-content: center; background: #FFD700; color: #1a1a2e; font-size: 20px; }
.wcs-author-info { flex: 1; }
.wcs-author-name { font-weight: 600; font-size: 21px; color: #212529; }
.wcs-author-meta { font-size: 14px; color: #8c8c8c; margin-top: 3px; }
.wcs-cat-link { color: #007bff !important; text-decoration: none !important; }
.wcs-cat-link:hover { text-decoration: underline !important; }

/* Owner actions top-right */
.wcs-owner-actions { display: flex !important; align-items: center; gap: 8px; margin-left: auto; }
.wcs-action-btn {
    display: inline-flex !important; align-items: center; gap: 5px;
    background: none !important; border: none !important; font-size: 16px;
    color: #ccc !important; cursor: pointer; padding: 4px 8px; border-radius: 3px;
    font-family: inherit; transition: color .18s, background .18s;
}
.wcs-action-btn:hover { color: #FFD700 !important; background: rgba(240,180,41,.08) !important; }
.wcs-delete-btn:hover { color: #ef4444 !important; background: rgba(239,68,68,.08) !important; }

.wcs-divider { border: none; border-top: 1px solid #f0f0f0; margin: 0 0 18px; }

/* Title & body */
.wcs-title { font-size: 18px; font-weight: bold; color: #212529; margin: 0 0 8px; line-height: 1.35; }
.wcs-body { font-size: 14px; color: #212529; line-height: 1.7; margin-bottom: 16px; }

/* Media */
.wcs-media-grid { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.wcs-media-item { width: 200px; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; display: block; }

/* Footer actions */
.wcs-footer-actions { display: flex !important; gap: 8px; padding-top: 16px; border-top: 1px solid #f0f0f0; justify-content: flex-end; }

/* Comments */
.wcs-comments-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px 20px; }
.wcs-comments-header { display: flex !important; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: #212529; cursor: pointer; user-select: none; }
.wcs-comments-header i.fa-comment { color: #000; }
.wcs-chevron { margin-left: auto; font-size: 13px; color: #9ca3af; transition: transform .25s ease; }
.wcs-comments-header.open .wcs-chevron { transform: rotate(180deg); }
.wcs-btn-add-comment {
    background: #FFD700 !important; color: #212529 !important;
    border: none !important; border-radius: 4px; padding: 10px 17px;
    font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: background .18s; flex-shrink: 0;
}
.wcs-btn-add-comment:hover { background: #ffd700 !important; }
.wcs-sort-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 10px; border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.wcs-sort-controls { display: flex; align-items: center; gap: 10px; }
.wcs-sort-label { font-size: 13px; color: #6b7280; font-weight: 600; }
#wcs-sort-select {
    border: 1px solid #d1d5db !important; border-radius: 6px; padding: 5px 10px;
    font-size: 13px; font-family: inherit; color: #1a1a2e; background: #fff;
    cursor: pointer; outline: none !important;
}
#wcs-sort-select:focus { border-color: #FFD700 !important; }
.wcs-no-comments { font-size: 13px; color: #9ca3af; margin: 12px 0 16px; }

.wcs-comment-card { border-bottom: 1px solid #f3f4f6; padding: 20px 0; }
.wcs-comment-card:last-of-type { border-bottom: none; }
.wcs-cmt-actions { display: flex !important; justify-content: flex-end; gap: 16px; margin-top: 8px; }
.wcs-cmt-action-btn { background: none !important; border: none !important; font-size: 14px; color: #ccc !important; cursor: pointer; padding: 3px 0; font-family: inherit; display: inline-flex !important; align-items: center; gap: 5px; transition: color .18s; }
.wcs-cmt-action-btn:hover { color: #ffd700  !important; }
.wcs-delete-cmt-btn:hover { color: #ef4444 !important; }
.wcs-reply-form-wrap { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;}
.wcs-comment-replies-count { display: inline-flex !important; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #ccc; cursor: pointer; margin-top: 8px; user-select: none; }
.wcs-comment-replies-count:hover { color: #FFD700; }
.wcs-replies-list { margin: 8px 0 4px 46px; padding-left: 14px; }
.wcs-reply-card { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.wcs-reply-card:last-child { border-bottom: none; }

/* See More / See Less toggle (inherits .wcs-cmt-action-btn styling) */
.wcs-see-toggle { color: #212529 !important; font-weight: 600; padding: 4px 0 !important; }
.wcs-see-toggle:hover { color: #212529 !important; }

/* Clamp for long comment/reply bodies. The actual max-height is set
 * inline by JS (measureAndAdjustClamp) as line-height × N — 6 lines on
 * desktop, 8 on mobile (≤768px) — so this works for rich HTML where
 * -webkit-line-clamp would fail (multiple <p>/lists/blockquotes). */
.wcs-clampable.wcs-clamped {
    overflow: hidden;
}

/* Show N more replies link inside .wcs-replies-list */
.wcs-show-more-replies {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    margin-top: 10px;
    user-select: none;
    transition: color .18s;
}
.wcs-show-more-replies:hover { color: #f0b429; }
.wcs-show-more-replies i { color: inherit; }

/* Show More Comments button below the comments list */
.wcs-show-more-comments-wrap { text-align: center; margin: 18px 0 4px; }
.wcs-btn-show-more-comments {
    background: #FFD700;
    color: #212529;
    border: none;
    border-radius: 6px;
    text-transform: uppercase;
    padding: 10px 22px;
    font-size: 15px;
    box-shadow:0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.wcs-btn-show-more-comments:hover { background: #000000; color: #ffffff; }
.wcs-comment-top { display: flex !important; align-items: center; gap: 10px; margin-bottom: 8px; }
.wcs-comment-av { width: 30px; height: 30px; object-fit: cover; flex-shrink: 0; }
.wcs-comment-author { font-weight: 700; font-size: 14px; color: #1a1a2e; display: block; }
.wcs-comment-time { font-size: 12px; color: #9ca3af; }
.wcs-comment-body { font-size: 14px; color: #374151; padding-left: 0px;}
.wc-user-link { color: inherit; text-decoration: none; }
.wc-user-link:hover { text-decoration: underline; }

/* Add comment */
.wcs-add-comment { background: #d3d3d338; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px 20px; margin-bottom: 16px; }
.wcs-comment-actions { display: flex !important; gap: 12px; justify-content: center; margin-top: 40px; }
.wcs-btn-post {
    background: #FFD700 ; color: #212529 !important;
    border: none !important; border-radius: 4px; padding: 9px 32px;
    font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: background .18s;
}
.wcs-btn-post:hover { background: #ffd700 !important; }

/* Login modal */
.wc-modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9200; align-items: center; justify-content: center; padding: 16px; }
.wc-modal-backdrop.open { display: flex !important; animation: wc-bd-in .2s ease; }
@keyframes wc-bd-in { from { opacity: 0; } to { opacity: 1; } }
.wc-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 580px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: wc-m-in .22s ease; display: flex; flex-direction: column; max-height: 92vh; }
@keyframes wc-m-in { from { opacity: 0; transform: scale(.95) translateY(-10px); } to { opacity: 1; transform: none; } }
.wc-modal-login { max-width: 480px !important; }
.wc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 700; color: #1a1a2e; flex-shrink: 0; }
.wc-modal-login .wc-modal-head { background: #FFD700 !important; border-radius: 0px 0px 0 0; border-bottom: none !important; padding: 16px 22px !important; }
.wc-modal-login .wc-modal-head span { font-size: 18px; font-weight: 500; color: #212529 !important; }
.wc-modal-x { background: none !important; border: none !important; color: #212529 !important; font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: color .18s; }
.wc-modal-x:hover { background: rgba(0,0,0,.1) !important; }
.wc-modal-body { padding: 16px !important; overflow-y: auto; flex: 1; }
.wc-login-desc { text-align: center; font-size: 14px; color: #212529; margin: 0 0 28px; line-height: 1.6; }
.wc-login-options { display: flex !important; gap: 20px; justify-content: center; }
.wc-login-option { display: flex !important; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
a.wc-btn-login-outline { display: block !important; width: 100%; text-align: center; background: #fff !important; color: #212529 !important; border: 2px solid #FFD700 !important; border-radius: 0px; padding: 10px 17px; font-size: 15px; font-weight: 700 !important; text-decoration: none !important; transition: background .18s; box-sizing: border-box; }
a.wc-btn-login-outline:hover { background: #FFD700 !important; text-decoration: none !important; }
a.wc-btn-login-primary { display: block !important; width: 100%; text-align: center; background: #FFD700 !important; color: #212529 !important; border: 2px solid #FFD700 !important; border-radius: 0px; padding: 10px 17px; font-size: 15px; font-weight: 700 !important; text-decoration: none !important; transition: background .18s; box-sizing: border-box; }
a.wc-btn-login-primary:hover { background: #ffd700 !important; border-color: #ffd700 !important; text-decoration: none !important; }
a.wc-login-sub-link { font-size: 14px !important; color: #007bff !important; text-decoration: none !important; font-weight: 500; }
a.wc-login-sub-link:hover { text-decoration: underline !important; }

/* Confirm modal */
.wcs-overlay-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9000; align-items: center; justify-content: center; }
.wcs-overlay-modal.open { display: flex !important; }
.wcs-confirm-box { background: #fff; max-width: 400px; width: 100%; text-align: center; }
.wcs-confirm-box p { font-size: 14px; color: #212529; margin: 0 0 22px; }
.wcs-confirm-actions { display: flex !important; gap: 12px; justify-content: center; }
.wcs-btn-cancel { background: #fff !important; color: #212529 !important; border: 1px solid #ffd700 !important; border-radius: 4px; padding: 9px 24px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.wcs-btn-danger { background: #ef4444 !important; color: #fff !important; border: none !important; border-radius: 4px; padding: 9px 24px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* Edit modal */
.wcs-edit-box {
    background: #fff; width: 100%; max-width: 640px;
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.wcs-edit-head {
    display: flex !important; align-items: center; justify-content: space-between;
    background: #FFD700; padding: 16px 20px; font-size: 16px; font-weight: 700; color: #1a1a2e;
    flex-shrink: 0;
}
.wcs-edit-head button, .wcs-confirm-head button {
    background: none !important; border: none !important; font-size: 24px; line-height: 1;
    cursor: pointer; color: #212529 !important; padding: 0 4px;
}
.wcs-edit-body { padding: 20px; overflow-y: auto; flex: 1; }
.wcs-edit-field { margin-bottom: 16px; }
.wcs-edit-label { display: block; font-size: 14px; font-weight: 600; color: #212529; margin-bottom: 6px; }
.wcs-edit-field input[type="text"],
.wcs-edit-field textarea {
    width: 100% !important; border: 1px solid #d1d5db !important; border-radius: 8px;
    padding: 10px 12px !important; font-size: 14px; font-family: inherit;
    outline: none !important; box-shadow: none !important; background: #fff !important;
    transition: border-color .18s; resize: vertical;
}
.wcs-edit-field input[type="text"]:focus,
.wcs-edit-field textarea:focus { border-color: #FFD700 !important; }
#wcs-edit-upload-btn {
    background: #ffffff !important; border: 1px solid #d1d5db !important;
    border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 600;
    color: #374151 !important; cursor: pointer; font-family: inherit;
}
#wcs-edit-upload-btn:hover { background: #e5e7eb !important; }
.wcs-edit-hint { font-size: 12px; color: #9ca3af; margin: 6px 0 10px; }
.wcs-edit-media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.wcs-edit-media-item {
    position: relative; width: 181px; height: 121px; border-radius: 8px;
    overflow: hidden; border: 1px solid #e5e7eb;
}
.wcs-edit-media-item img,
.wcs-edit-media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcs-edit-media-item img,
.wcs-edit-media-item video { position: relative; z-index: 0; }
.wcs-media-check {
    position: absolute; top: 6px; left: 6px; width: 16px; height: 16px;
    cursor: pointer; z-index: 3; accent-color: #FFD700;
}
.wcs-btn-remove-selected {
    background: #ef4444 !important; color: #fff !important; border: none !important;
    border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background .18s;
}
.wcs-btn-remove-selected:hover { background: #dc2626 !important; }
.wcs-edit-media-del {
    position: absolute; top: 4px; right: 4px;
    background: rgba(239,68,68,.85) !important; border: none !important;
    border-radius: 50%; width: 24px; height: 24px; display: flex !important;
    align-items: center; justify-content: center; cursor: pointer; color: #fff !important;
    font-size: 12px; padding: 0;
}
.wcs-edit-media-del:hover { background: #ef4444 !important; }
.wcs-edit-foot {
    display: flex !important; gap: 12px; justify-content: center;
    padding: 16px 20px; border-top: 1px solid #f0f0f0; flex-shrink: 0;
}
.wcs-btn-update {
    background: #FFD700 !important; color: #212529 !important; border: none !important;
    border-radius: 4px; padding: 10px 32px; font-size: 14px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background .18s;
}
.wcs-btn-update:hover { background: #ffd700 !important; }

@media (max-width: 600px) {
    .wcs-author-row { flex-wrap: wrap; }
    .wcs-owner-actions { width: 100%; justify-content: flex-end; }
    .wcs-media-item { width: 140px; height: 110px; }
    .wcs-btn-add-comment { padding: 7px 12px; font-size: 13px; margin-left: 0 !important; }
}

/* ---- TinyMCE mobile fixes ---- */
@media (max-width: 768px) {
    /* transform-origin so JS scale() anchors from top-left */
    .mce-floatpanel.mce-window {
        transform-origin: top left !important;
    }
    /* Prevent TinyMCE editor toolbar from overflowing */
    .mce-toolbar-grp, .mce-top-part { overflow-x: auto !important; }
    .mce-tinymce, .mce-edit-area { max-width: 100% !important; box-sizing: border-box !important; }
}

/* ---- Lightbox ---- */
#wcs-lightbox {
    display: none;
}
#wcs-lightbox-img {
    border-radius: 0 !important; background: none !important;
    box-shadow: none !important;
}
#wcs-lightbox-close {
    border-radius: 50% !important; cursor: pointer !important;
    box-shadow: none !important;
}
#wcs-lightbox-prev, #wcs-lightbox-next {
    cursor: pointer !important; border-radius: 0 !important; box-shadow: none !important;
}
#wcs-lightbox-prev { left: 0 !important; }
#wcs-lightbox-next { right: 0 !important; }
#wcs-lightbox-prev:hover, #wcs-lightbox-next:hover { background: rgba(255,255,255,.32) !important; }
#wcs-lightbox-counter {
    position: absolute !important; top: 20px !important;
    left: 50% !important; transform: translateX(-50%) !important;
    color: #fff !important; font-size: 14px !important;
    background: rgba(0,0,0,.5) !important;
    padding: 4px 14px !important; border-radius: 14px !important;
    z-index: 1000000 !important;
}
.wcs-lightbox-trigger { cursor: pointer !important; }

/* ---- Edit modal sort toggle ---- */
.wcs-btn-sort {
    display: inline-flex !important; align-items: center; gap: 6px;
    background: #f3f4f6 !important; border: 1px solid #d1d5db !important;
    border-radius: 6px !important; padding: 6px 14px !important;
    font-size: 12px !important; font-weight: 600; cursor: pointer;
    color: #212529 !important; transition: background .15s;
}
.wcs-btn-sort:hover { background: #e5e7eb !important; }
.wcs-sort-overlay {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    display: flex !important; align-items: center; justify-content: center;
    background: rgba(0,0,0,.4) !important; z-index: 4 !important;
    pointer-events: none !important; border-radius: 8px !important;
}
.wcs-drag-icon { color: #fff !important; font-size: 22px !important; }
.wcs-sort-placeholder {
    float: left !important; margin: 0 8px 8px 0 !important;
    width: 120px !important; height: 90px !important; border-radius: 8px !important;
    background: #e5e7eb !important; border: 2px dashed #9ca3af !important;
}
