/* Comments Container */
#discusly-comments-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Comments Header */
#comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

#comments-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.25em;
}

#comments-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#comments-search {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

#comments-order,
#comments-per-page {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Loading Spinner */

#comments-wrapper {
    position: relative;
}

#comments-spinner {
    position: absolute;
    top: 5%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6); /* translucent white */
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
    
}

#comments-spinner .spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.spinner {
    /*
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;*/
    
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #f3f3f3;
    border-top: 1px solid #007cba;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #f3f3f3;
    border-top: 1px solid #007cba;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Comments List */
#comments-list {
    padding: 0;
}

/* Comment Item */
.comment-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.comment-item:last-child {
    border-bottom: none;
}

/* Nested Comments Container */
.comment-item .nested-comments {
    margin-top: 15px;
    margin-left: 40px;
    position: relative;
}

.comment-item.with-branch-line .nested-comments {
    /*
    border-left: 2px solid #e9ecef;
    padding-left: 20px;*/
}

/*
.comment-item.with-branch-line .nested-comments::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -2px;
    width: 22px;
    height: 15px;
    border-bottom: 2px solid #e9ecef;
    border-left: 2px solid #e9ecef;
    border-bottom-left-radius: 8px;
}*/

.nested-comments .nested-comment.nested-with-branch:first-child::before {
    content: '';
    position: absolute;
    top: 0; /*adjust this if required 8px*/
    left: -22px;
    width: 15px;
    height: 25px;
    border-bottom: 1px solid #e9ecef;
    border-left: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}


/* Comment Header 
.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}*/
.comment-header {
    display: flex;
    align-items: flex-start; /* This is key */
    gap: 12px;
}

.comment-avatar-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Optional: center the button under avatar */
    gap: 6px; /* Controls space between avatar and nested button */
    flex-shrink: 0;
}



.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    border-radius: 50%;
    border: 2px solid #f0f0f0;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.lazy-avatar {
    border-radius: 50%;
    border: 2px solid #f0f0f0;
    background: #f8f9fa;
    transition: opacity 0.3s ease;
}

.comment-meta {
    flex-grow: 1;
}

.comment-author {
    color: #333;
    font-weight: 600;
    font-size: 15px;
    margin-right: 8px;
}

.comment-date {
    color: #666;
    font-size: 13px;
}

/* Comment Content */
.comment-content {
    color: #444;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-content p {
    margin: 0 0 12px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.reply-btn,
.load-nested,
.nested-load-btn {
    background: none;
    border: none;
    color: #007cba;
    font-size: 13px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reply-btn:hover,
.load-nested:hover,
.nested-load-btn:hover {
    background: #f0f8ff;
    color: #005a8c;
}

.reply-btn:disabled,
.load-nested:disabled,
.nested-load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nested-icon {
    font-weight: bold;
    font-size: 12px;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
}

.load-nested.expanded .nested-icon {
    transform: rotate(0deg);
}

/* Nested load button styling */
.nested-load-btn {
    font-size: 12px;
    padding: 4px 8px;
    color: #666;
}

.nested-load-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Nested Comments */
.nested-comments {
    margin-top: 15px;
}

.nested-comment {
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}

.nested-comment:last-child {
    border-bottom: none;
}

/* Tree Lines for Nested Comments */
.nested-comment.nested-with-branch {
    position: relative;
    margin-left: 0;
}

.nested-comment.nested-with-branch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -22px;
    width: 15px;
    height: 25px;
    border-bottom: 1px solid #e9ecef;
    border-left: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}

.nested-comment.nested-with-branch::after {
    content: '';
    position: absolute;
    top: 25px;
    left: -22px;
    bottom: -15px;
    width: 1px;
    background: #e9ecef;
}

.nested-comment.nested-with-branch:last-child::after {
    display: none;
}

/* Depth-based indentation */
.nested-comment.depth-1 {
    margin-left: 0;
}

.nested-comment.depth-2 {
    margin-left: 20px;
}

.nested-comment.depth-3 {
    margin-left: 40px;
}

.nested-comment.depth-4 {
    margin-left: 60px;
}

.nested-comment.depth-5 {
    margin-left: 80px;
}

/* Nested comment avatars */
.nested-comment .comment-avatar img,
.nested-comment .avatar-placeholder {
    width: 30px !important;
    height: 30px !important;
}

.depth-2 .comment-avatar img,
.depth-2 .avatar-placeholder {
    width: 28px !important;
    height: 28px !important;
}

.depth-3 .comment-avatar img,
.depth-3 .avatar-placeholder {
    width: 26px !important;
    height: 26px !important;
}

.depth-4 .comment-avatar img,
.depth-4 .avatar-placeholder,
.depth-5 .comment-avatar img,
.depth-5 .avatar-placeholder {
    width: 24px !important;
    height: 24px !important;
}

/* Reply Form */
/*
.reply-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}*/

.reply-form h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.reply-form .form-row {
    display: flex;
    /*
    gap: 12px;
    margin-bottom: 12px;*/
}

.reply-form input,
.reply-form textarea {
    padding: 10px 12px;
    border: 0px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.reply-form input:focus,
.reply-form textarea:focus {
    outline: none;
    /*
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);*/
}

.reply-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.submit-reply,
.cancel-reply {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.submit-reply {
    background: #007cba;
    color: white;
}

.submit-reply:hover:not(:disabled) {
    background: #005a8c;
}

.submit-reply:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cancel-reply {
    background: #6c757d;
    color: white;
}

.cancel-reply:hover {
    background: #545b62;
}

/* Load More Button */
#load-more-container {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.load-more-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.load-more-button:hover {
    background: #005a8c;
    transform: translateY(-1px);
}

.load-more-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #007cba;
}

.pagination-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

/* Auto Load Trigger */
#auto-load-trigger {
    height: 1px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    #discusly-comments-container {
        margin: 0 10px;
        border-radius: 0;
        box-shadow: none;
        border: 1px solid #e9ecef;
    }
    
    #comments-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }
    
    #comments-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    #comments-search {
        width: 100%;
    }
    
    .comment-item {
        padding: 15px;
    }
    
    .comment-item.with-branch-line .nested-comments {
        margin-left: 15px;
        padding-left: 15px;
    }
    
    /* Mobile nested comment adjustments */
    .nested-comment.depth-2,
    .nested-comment.depth-3,
    .nested-comment.depth-4,
    .nested-comment.depth-5 {
        margin-left: 10px;
    }
    
    .nested-comment.nested-with-branch::before {
        left: -12px;
        width: 10px;
    }
    
    .nested-comment.nested-with-branch::after {
        left: -12px;
    }
    
    .reply-form .form-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .submit-reply,
    .cancel-reply {
        width: 100%;
        justify-content: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .pagination-btn {
        min-width: 40px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .comment-header {
        gap: 8px;
    }
    
    .comment-avatar img,
    .avatar-placeholder {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nested-comment .comment-avatar img,
    .nested-comment .avatar-placeholder {
        width: 24px !important;
        height: 24px !important;
    }
    
    .depth-2 .comment-avatar img,
    .depth-2 .avatar-placeholder,
    .depth-3 .comment-avatar img,
    .depth-3 .avatar-placeholder,
    .depth-4 .comment-avatar img,
    .depth-4 .avatar-placeholder,
    .depth-5 .comment-avatar img,
    .depth-5 .avatar-placeholder {
        width: 20px !important;
        height: 20px !important;
    }
    
    .comment-author {
        font-size: 14px;
    }
    
    .comment-date {
        font-size: 12px;
    }
    
    .comment-content {
        font-size: 14px;
    }
    
    .comment-item .nested-comments {
        margin-left: 15px;
    }
    
    .comment-actions {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .reply-btn,
    .load-nested,
    .nested-load-btn {
        font-size: 12px;
        padding: 4px 6px;
    }
}

/*reply form css*****************************/
.comment-meta-content{
    width:100%;
}

/*
.reply-form.reply-inline {
    margin-top: 10px;
}

.reply-textarea-wrapper {
    position: relative;
    width: 100%;
}

.reply-input {
    width: 100%;
    padding: 8px 90px 8px 12px; // extra padding on right for icons 
    border: 1px solid #ccc;
    border-radius: 20px;
    resize: none;
    font-size: 14px;
    background: #fff;
    line-height: 1.4;
    overflow-y: hidden;
}

.reply-input:focus {
    outline: none;
    border-color: #007cba;
}

.emoji-icon,
.camera-icon,
.submit-reply-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.emoji-icon {
    right: 50px;
    pointer-events: none;
}

.camera-icon {
    right: 25px;
    pointer-events: none;
}

.submit-reply-btn {
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3; // on top of icons 
}

.submit-reply-btn svg {
    stroke: #007cba;
}

.submit-reply-btn:hover svg {
    stroke: #005a8c;
}*/

/*
.reply-form {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
}*/

.reply-avatar img {
    border-radius: 50%;
}

.reply-editor-wrapper {
    position: relative;
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
    transition: all 0.3s ease;
}

.reply-editor-wrapper.collapsed {
    padding: 5px 10px;
    max-height: 50px;
    overflow: hidden;
}

.reply-toolbar-toggle {
    position: absolute;
    top: 5px;
    right: 8px;
}

.reply-toolbar-toggle button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.reply-toolbar-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #888;
}

.reply-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
    padding-top: 5px;
}

.reply-toolbar button {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 12px;
    cursor: pointer;
}

.reply-textarea-wrapper {
    position: relative;
}

.reply-input {
    width: 100%;
    resize: none;
    padding: 40px 80px 40px 40px;
    border: none;
    outline: none;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 6px;
    min-height: 60px;
    box-sizing: border-box;
    background: transparent;
}

.reply-bottom-bar {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.reply-left-icons,
.reply-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.emoji-icon,
.camera-icon {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.emoji-icon svg,
.camera-icon svg {
    width: 18px;
    height: 18px;
    stroke: #ccc;
}

.submit-reply-btn,
.cancel-reply-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-reply-btn svg {
    stroke: #007cba;
}

.cancel-reply-btn svg {
    stroke: #999;
}


/*************************************************************************/

/*svg icon stroke color*/
.icon {
  stroke: #bbb;
  fill: none;
  vertical-align: middle;
}

