/* Social Wall Widget Styles */
.socialwall-widget {
    margin-bottom: 2rem;
}

.socialwall-widget .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 15px;
}

.socialwall-widget .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

.socialwall-widget .card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Sorting Options */
.sorting-options .btn-group .btn {
    border-radius: 20px;
    margin-right: 5px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.sorting-options .btn-group .btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Post Cards */
.post-card .card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.post-card .card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.post-header h6 {
    color: #495057;
    font-size: 1rem;
}

.post-content p {
    color: #6c757d;
    line-height: 1.6;
}

/* Post Images - Thumbnails */
.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.post-images .post-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.post-images .post-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: #007bff;
}

/* Badge dropdown: ensure menu stays on top of all page content */
.badge-dropdown .dropdown-menu {
    z-index: 10050;
}

/* Full Screen Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 14px;
    background-color: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    max-width: 80%;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.lightbox-nav:hover {
    background-color: rgba(255,255,255,0.3);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;    
    color: white !important;
    background-color: rgba(0,0,0,0.7);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover {
    background-color: yellow !important;
    color: black !important;
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white !important;
    background-color: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Hide navigation buttons when only one image */
.lightbox-nav.hidden {
    display: none;
}

/* Badges (awarded badges display) */
.post-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.post-badges .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 15px;
    margin-right: 0;
    margin-bottom: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    max-width: 2.5em;
    transition: max-width 0.25s ease;
}

.post-badges .badge:hover {
    max-width: 20em;
}

.post-badges .badge .badge-text {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width 0.25s ease, opacity 0.2s ease, margin-left 0.2s ease;
    margin-left: 0;
}

.post-badges .badge:hover .badge-text {
    max-width: 16em;
    opacity: 1;
    margin-left: 0.35em;
}

.badge-count {
    background-color: rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 0.125rem 0.375rem;
    margin-left: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Post Actions */
.post-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

/* Badge button group: single pill with semi-circular ends */
.badge-actions .btn-group {
    border: 1px solid #e9ecef;
    border-radius: 9999px;
    overflow: hidden;
}

.badge-actions .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0;
    border-radius: 0;
    border: none;
    border-left: 1px solid #e9ecef;
    transition: background-color 0.15s ease;
}

.badge-actions .btn-group .btn:first-child {
    border-radius: 9999px 0 0 9999px;
    border-left: none;
}

.badge-actions .btn-group .btn:last-child {
    border-radius: 0 9999px 9999px 0;
}

.badge-actions .btn-group .btn:only-child {
    border-radius: 9999px;
}

.badge-actions .btn-group .btn:hover {
    background-color: #f8f9fa;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.comment-item {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.comment-item strong {
    color: #495057;
    font-size: 0.875rem;
}

.comment-item p {
    margin: 0.5rem 0 0 0;
    color: #6c757d;
    font-size: 0.875rem;
}

.add-comment-form .input-group textarea {
    border-radius: 20px 0 0 20px;
    border-right: none;
    resize: none;
}

.add-comment-form .input-group .btn {
    border-radius: 0 20px 20px 0;
    border-left: none;
}

/* Image Preview */
#image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#image-preview .preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

#image-preview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#image-preview .preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .socialwall-widget .card-header {
        padding: 1rem;
    }
    
    .sorting-options .btn-group {
        width: 100%;
    }
    
    .sorting-options .btn-group .btn {
        flex: 1;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .post-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .badge-actions .btn-group {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .badge-actions .btn-group .btn {
        flex: 1;
        min-width: 80px;
        border-radius: 9999px;
        border-left: none;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .post-card .card {
    background-color: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .post-header h6 {
    color: #e2e8f0;
}

[data-theme="dark"] .post-content p {
    color: #a0aec0;
}

[data-theme="dark"] .comment-item {
    background-color: #4a5568;
}

[data-theme="dark"] .comment-item strong {
    color: #e2e8f0;
}

[data-theme="dark"] .comment-item p {
    color: #a0aec0;
}

[data-theme="dark"] .comments-section,
[data-theme="dark"] .post-actions {
    border-color: #4a5568;
}

[data-theme="dark"] .badge-actions .btn-group {
    border-color: #4a5568;
}

[data-theme="dark"] .badge-actions .btn-group .btn {
    border-left-color: #4a5568;
}

[data-theme="dark"] .badge-actions .btn-group .btn:hover {
    background-color: #4a5568;
}

[data-theme="dark"] .post-badges .badge {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    pointer-events: auto;
    margin-bottom: 10px;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 8px;
}

.toast-notification .toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification .toast-icon {
    font-size: 1.2rem;
}

.toast-notification .btn-close {
    pointer-events: auto;
}

/* Delete Confirmation Modals */
#deletePostModal .modal-content,
#deleteCommentModal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Prevent modal from scrolling to top */
#deletePostModal,
#deleteCommentModal {
    overflow-y: auto;
}

#deletePostModal .modal-dialog,
#deleteCommentModal .modal-dialog {
    margin: 1.75rem auto;
    max-height: calc(100vh - 3.5rem);
}

#deletePostModal .modal-header,
#deleteCommentModal .modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

#deletePostModal .modal-title,
#deleteCommentModal .modal-title {
    font-weight: 600;
    color: #495057;
}

#deletePostModal .modal-body,
#deleteCommentModal .modal-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #6c757d;
}

#deletePostModal .modal-footer,
#deleteCommentModal .modal-footer {
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

#deletePostModal .btn-danger,
#deleteCommentModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    font-weight: 500;
}

#deletePostModal .btn-danger:hover,
#deleteCommentModal .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Dark mode support for delete modals */
[data-theme="dark"] #deletePostModal .modal-header,
[data-theme="dark"] #deleteCommentModal .modal-header,
[data-theme="dark"] #deletePostModal .modal-footer,
[data-theme="dark"] #deleteCommentModal .modal-footer {
    background-color: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] #deletePostModal .modal-title,
[data-theme="dark"] #deleteCommentModal .modal-title {
    color: #e2e8f0;
}

[data-theme="dark"] #deletePostModal .modal-body,
[data-theme="dark"] #deleteCommentModal .modal-body {
    background-color: #1a202c;
    color: #a0aec0;
}

[data-theme="dark"] #deletePostModal .modal-content,
[data-theme="dark"] #deleteCommentModal .modal-content {
    background-color: #1a202c;
    border: 1px solid #4a5568;
}







.post-message{
    border: 1px solid #CFCFCF;
    width: 100%;
    min-height: 100px;
    max-height: 250px;
    padding:12px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .post-message{
    background-color: #2d2d2d;
    color: #e2e8f0;
}

.post-area{
    border:0px;
    width:100%;
    resize:none;
}

.post-area:focus{
    box-shadow: none;
    outline:none;
}

.post-file-upload{
    cursor:pointer;
}

#fileInput{
    display:none;
}

.post-button{
    background-color: #10b981;
    color:white;
    border:none;
    width:35px;
    height:35px;
    border-radius: 50%;
    cursor:pointer;
    display:flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.post-button:hover{
    background-color:#6ea8fe;
}

/* File Preview Styles */
#divFiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#divFiles .preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

#divFiles .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#divFiles .preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease;
}

#divFiles .preview-item .remove-btn:hover {
    background: rgba(220, 53, 69, 1);
}

/* Quick-post modal: reuse divFiles-style preview */
#quickPostFilePreview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#quickPostFilePreview .preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

#quickPostFilePreview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#quickPostFilePreview .preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease;
}

#quickPostFilePreview .preview-item .remove-btn:hover {
    background: rgba(220, 53, 69, 1);
}

/* Floating action button: show when scrolled down */
.socialwall-fab {
    position: fixed;
    bottom:75px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #6ea8fe 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
    z-index: 1050;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.socialwall-fab:hover {
    transform: scale(1.05);
    color: white;
}

.socialwall-fab--hidden {
    display: none !important;
}