/* CRITICAL: Ensure sticky navigation works */
#sticky-navigation {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    background: white !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    display: block !important;
    /* Prevent JavaScript jumping - keep our sticky positioning */
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* CRITICAL: Override the generic section rule from style.css for mobile */
@media (max-width: 1023px) {
    section#sticky-navigation {
        position: -webkit-sticky !important;
        position: sticky !important;
        float: none !important;
    }
}

  /* Modal styles */
    #cropImageModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

#cropImageModal .modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 800px;
    max-height: 600px;
    margin: 5% auto;
    display: flex;
    flex-direction: column;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
}

#cropImageModal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

#cropImageModal .img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    min-height: 300px;
    max-height: 450px;
}

#cropImageModal .img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#cropImageModal .crop-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 10001;
}

#cropImageModal .crop-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#cropImageModal .crop-controls .btn-cancel {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

#cropImageModal .crop-controls .btn-crop {
    background-color: #007bff;
    color: #fff;
}

#cropImageModal .crop-controls .btn-crop:hover {
    background-color: #0056b3;
}

#cropImageModal .crop-controls .btn-cancel:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #cropImageModal .modal-content {
        width: 95%;
        height: 85%;
        max-width: none;
        max-height: none;
        margin: 7.5% auto;
    }
    
    #cropImageModal .img-container {
        min-height: 250px;
        max-height: 350px;
    }
    
    #cropImageModal .crop-controls {
        padding: 15px;
        gap: 10px;
    }
    
    #cropImageModal .crop-controls button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    #cropImageModal .close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    #cropImageModal .modal-content {
        width: 85%;
        height: 80%;
        max-width: 900px;
        max-height: 700px;
        margin: 10% auto;
    }
    
    #cropImageModal .img-container {
        min-height: 350px;
        max-height: 500px;
    }
}

/* Cropper.js customizations */
.cropper-container {
    background-color: #000 !important;
}

.cropper-view-box {
    border-radius: 0 !important;
}

.cropper-face {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

.cropper-line, .cropper-point {
    background-color: #fff !important;
}

.cropper-view-box {
    outline: 2px solid #fff !important;
}

/* Previous Images Modal Styling */
.image-selection-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.image-selection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.image-selection-card.selected {
    border-color: #28a745;
    background-color: #f8fff9;
}

        .select-box__icon.rotate {
            transform: translateY(-50%) rotate(180deg);
        }
 
        
        .ql-editor{
            max-height: unset !important;  /* Ensure Quill's editor does not impose its own scroll */
            overflow: visible !important;
            border: none !important; /* Remove duplicate border - #editor already has the border */
            border-radius: 8px !important;
            transition: border-color 0.2s ease !important;
        }

        .ql-editor:focus-within {
            border-color: #1877f2 !important;
            box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2) !important;
        }

        .ql-editor a,
        .ql-editor a * {
            color: #0066cc !important;
            text-decoration: underline !important;
            font-weight: 500 !important;
        }


        .ql-editor, .ql-editor p {
            color: black !important;
            font-size:1.2rem;
        }


        a.Like__link,
        a.comment-to,
        a.btn,
        a[class*="toggle-"],
        a[href="#"] {
          text-decoration: none !important;
          color: inherit !important;
          font-weight: normal !important;
        }
                
        #editor {
            height: 200px;
            overflow-y: auto;
        }

        #embed-holder {
            border: none; /* No border initially */
            border-radius: 10px;
            padding: 2px;
            overflow-y: auto;
            max-height: 200px; /* Adjust as needed */
        }

        div#embed-holder div.embed-wrapper {
        /* display: inline-block; temp remove to make youtube full width*/
            position: relative;
            margin-top: 20px;
            border: 1px solid grey;
            padding: 10px;
            margin-bottom: 0px;

        }
        #embed-holder img {
            max-width: 100%;
            height: auto;
        }


        button.delete-embed-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10;
        }

        div.embed-wrapper button.delete-embed-btn img {
        width: 20px;
        height: 20px;
        }

        .post-meta{

            width: 100%; /* Make sure the wrapper takes up full width */
            box-sizing: border-box; /* Include padding and border in width calculation */
            word-wrap: break-word; /* Break long words, like URLs */
            overflow-wrap: break-word; /* Alternative property for wider browser support */
            overflow-x: hidden; /* Prevent horizontal overflow */


        }

        #posts-container .post-meta a{

            color: #0066cc;
            text-decoration: underline;
            font-weight: 500;
        }

        
        div.post-meta div.embed-wrapper img{
            text-align: center;
            max-width: 100%;
            height: auto;
        }


        
        div.embed-wrapper p, div.user-post p{
            font-size: 1.2rem;
            line-height: 1.5;
            overflow-wrap: break-word; /* Alternative property for wider browser support */
        }

        /* Facebook embed specific styles */
        .fb-post {
            max-width: 400px !important;
            margin: 10px 0 !important;
        }
        
        /* Make Facebook embeds more compact */
        div.embed-wrapper .fb-post {
            transform: scale(0.9);
            transform-origin: top left;
        }
        
        /* Instagram embed styles */
        .instagram-media {
            max-width: 400px !important;
            margin: 10px 0 !important;
        }
        
        /* Pinterest embed styles */
        .pinterest-embed {
            max-width: 400px !important;
            margin: 10px 0 !important;
        }

        div.commenter p{
            font-size: 1.2rem;
        }

  

        .no-posts-message {
            background-color: #f9f9fc;
            border: 1px dashed #bbb;
            color: #555;
            font-family: 'Segoe UI', sans-serif;
            max-width: 600px;
            margin: 0 auto;
            transition: all 0.3s ease;
        }



        .event-container {
            position: relative;
            margin-bottom: 20px; /* Adjust this to add some space below the image */
        }

        .event-dp {
            display: inline-block;
            margin: 0;
            position: relative; /* Change from absolute to relative */
        }

        .event-dp img {
            display: block;
            width: 100%; /* Adjust this as needed */
            height: auto; /* Ensure the image scales correctly */
        }

        .event-dp .edit-dp {
            background: rgba(255, 255, 255, 0.7) none repeat scroll 0 0;
            border: 1px solid #b3b3b3;
            border-radius: 100%;
            bottom: 0;
            height: 40px;
            line-height: 40px;
            position: absolute;
            right: 10px;
            text-align: center;
            transition: all 0.2s linear 0s;
            width: 40px;
        }

        .event-dp .edit-dp i {
            font-size: 22px;
            vertical-align: sub;
        }


        .notif-count {
          position: absolute;
          top: -6px;
          right: -6px;
          background: #ff5c5c;
          color: white;
          font-size: 14px;
          font-weight: bold;
          border-radius: 50%;
          width: 16px;
          height: 16px;
          display: flex;
          align-items: center;
          justify-content: center;
          z-index: 2;
        }

        .card.spark-card {
            position: relative;
        }

        .spark-icons {
            position: absolute;
            top: 10px;
            right: 10px;
            display: flex;
            gap: 5px;
            z-index: 10;
        }

        .spark-icons span {
            animation: sparklePulse 2s infinite;
            cursor: default;
        }

        .spark-icons span[title="AI Powered"] {
            color: #00bfff; /* Bright blue */
        }

        .spark-icons span[title="More details needed"] {
            color: #ff69b4; /* Hot pink */
        }

        @keyframes sparklePulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.7; }
        }

        /* If you’re still using an image icon for AI */
        .spark-ai-icon {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            z-index: 10;
        }

            .spark-expand {
            background-color: #f9f9f9;
            border-radius: 8px;
            padding: 12px;
            margin-top: 12px;
            }


        .spark-expand label span.text-danger {
            font-size: 0.8em;
        }
        .spark-expand .form-label {
            margin-bottom: 2px;
        }



/* Force navigation to always be visible on mobile */
.menu-caro .page-caro {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
}

/* Override any Owl Carousel hiding */
.menu-caro .page-caro.owl-hidden,
.menu-caro .page-caro.owl-carousel.owl-hidden {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
}

/* Hide text by default on all screen sizes */
.menu-caro .link-item p {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Show text on hover with proper positioning */
.menu-caro .link-item:hover p {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    bottom: -25px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    color: #088dcd !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
    font-weight: 500 !important;
    background: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Ensure proper spacing for navigation items */
.menu-caro .link-item {
    padding: 12px 10px 8px 10px !important;
    min-height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 5px !important;
    position: relative !important;
}

/* Make icons larger and ensure they're fully visible */
.menu-caro .link-item i,
.menu-caro .link-item svg {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    display: block !important;
}

/* Ensure the navigation row has proper spacing */
.menu-caro .page-caro {
    padding: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Remove any lines or borders that might appear over icons */
.menu-caro .link-item::before,
.menu-caro .link-item::after {
    display: none !important;
}

/* Keep the original active class line styling */
.link-item > a.active {
    border-bottom: 3px solid !important;
    padding-bottom: 15px !important; /* Increased padding to push line 5px lower */
    margin-bottom: 1px !important; /* Add tiny whitespace below the line */
}

/* Restore original navigation functionality */
.link-item > a {
    color: #adafca;
    display: block;
    font-size: 15px;
    position: relative !important;
    border-bottom: 3px solid transparent;
}

.link-item > a p {
    color: #3d3d49;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    text-transform: capitalize;
    transform: translateY(22px);
    transition: all 0.3s ease-in-out 0s;
}

.link-item > a:hover,
.link-item > a.active{
    border-bottom: 3px solid;
    padding-bottom: 15px !important; /* Increased padding to push line 5px lower */
    margin-bottom: 1px !important; /* Add tiny whitespace below the line */
}

/* Hide text by default, show on hover */
.link-item > a p {
    opacity: 0;
    visibility: hidden;
}

.link-item > a:hover p {
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #088dcd !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
}

/* Ensure proper navigation structure for JavaScript */
.menu-caro .page-caro {
    display: block;
    opacity: 1;
    visibility: visible;
    background: white !important;
    padding: 10px 0 !important;
}

/* Override .white-bg positioning to allow sticky positioning to work */
.white-bg {
    position: static !important; /* Override relative positioning */
    z-index: auto !important; /* Remove z-index interference */
    overflow: visible !important;
    transform: none !important;
    will-change: auto !important;
}

/* New sticky navigation section rule - positioned below the top header */
#sticky-navigation {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important; /* Position right at the top */
    z-index: 999 !important; /* Below the top header but above content */
    background: white !important;
    transform: none !important;
    will-change: auto !important;
    /* Ensure sticky works */
    display: block !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Performance optimizations for different devices */
/* High-performance devices (laptops, desktops) */
@media (min-width: 1024px) and (min-resolution: 1dppx) {
    #sticky-navigation,
    .responsive-header,
    header {
        /* Enable hardware acceleration for high-end devices */
        will-change: transform !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        /* Smooth scrolling for desktop */
        scroll-behavior: smooth !important;
    }
}

/* Mobile devices (phones, tablets) */
@media (max-width: 1023px) {
    #sticky-navigation,
    .responsive-header,
    header {
        /* Disable hardware acceleration on mobile to save battery */
        will-change: auto !important;
        transform: none !important;
        -webkit-transform: none !important;
        /* Disable smooth scrolling on mobile for better performance */
        scroll-behavior: auto !important;
        /* Optimize for touch scrolling */
        -webkit-overflow-scrolling: touch !important;
        overflow-scrolling: touch !important;
    }
    
    /* Prevent sticky jumping on mobile */
    #sticky-navigation {
        /* Force immediate stickiness on mobile */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        /* Prevent any margin/padding that could cause jumping */
        margin: 0 !important;
        padding: 0 !important;
        /* Ensure proper mobile positioning */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        /* Prevent transform issues on mobile */
        transform: none !important;
        -webkit-transform: none !important;
    }
}

/* WebView specific optimizations (mobile apps) */
@media (max-width: 1023px) and (-webkit-min-device-pixel-ratio: 2) {
    #sticky-navigation,
    .responsive-header,
    header {
        /* WebView-specific performance tweaks */
        position: sticky !important;
        /* Reduce z-index complexity for WebView */
        z-index: 100 !important;
        /* Disable transforms that can cause issues in WebView */
        transform: none !important;
        -webkit-transform: none !important;
        /* Optimize for WebView rendering */
        -webkit-backface-visibility: visible !important;
        backface-visibility: visible !important;
    }
    
    /* WebView-specific sticky fixes */
    #sticky-navigation {
        /* Force immediate stickiness in WebView */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        /* Prevent jumping in WebView */
        margin: 0 !important;
        padding: 0 !important;
        /* Ensure proper WebView positioning */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        /* Disable any transforms that could cause issues */
        transform: none !important;
        -webkit-transform: none !important;
        /* WebView-specific z-index */
        z-index: 50 !important;
    }
}

/* Performance fallbacks for problematic devices */
/* If sticky positioning fails, fall back to simpler positioning */
@supports not (position: sticky) {
    #sticky-navigation,
    .responsive-header,
    header {
        position: relative !important;
        top: auto !important;
        z-index: 1 !important;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    #sticky-navigation,
    .responsive-header,
    header {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #sticky-navigation,
    .responsive-header,
    header {
        /* Optimize for high DPI displays */
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: optimize-contrast !important;
    }
}

/* Fallback to fixed positioning if sticky fails */
#sticky-navigation.sticky-failed {
    position: fixed !important;
    top: 0 !important; /* Position right at the top */
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    background: white !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Prevent JavaScript sticky-kit from causing jumping */
#sticky-navigation.is_stuck,
#sticky-navigation[style*="position: fixed"],
#sticky-navigation[style*="position:fixed"] {
    /* Force our sticky positioning even if JavaScript tries to change it */
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    background: white !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    display: block !important;
    /* Prevent any JavaScript-caused jumping */
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
    animation: none !important;
    margin: 0 !important;
    padding: 0 !important;
}



/* Force sticky positioning with more aggressive overrides - TOP PRIORITY */
.responsive-header,
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1001 !important; /* Highest z-index for top navigation */
    background: white !important;
    transform: none !important;
    will-change: auto !important;
}





/* Fallback to fixed positioning if sticky fails */
.responsive-header.sticky-failed,
header.sticky-failed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
    background: white !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove sticky positioning from .menu-caro since it's now handled by #sticky-navigation */
.menu-caro {
    /* Sticky positioning now handled by parent #sticky-navigation */
    background: white !important;
    transform: none !important;
    will-change: auto !important;
    /* Ensure parent doesn't interfere with sticky */
    position: relative !important;
    overflow: visible !important;
}

/* Remove sticky positioning from .page-caro since it's now handled by #sticky-navigation */
.menu-caro .page-caro {
    /* Sticky positioning now handled by parent #sticky-navigation */
    background: white !important;
    transform: none !important;
    will-change: auto !important;
}

/* Mobile-specific layout adjustments */
@media only screen and (max-width: 767px) {
    /* Ensure navigation takes full width on mobile */
    .menu-caro .col-md-12 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 15px !important;
    }
}



/* Header show/hide logic for mobile vs desktop */
@media only screen and (max-width: 812px) {
    /* Mobile: Show responsive header, hide main header */
    .responsive-header {
        display: block !important;
    }
    header {
        display: none !important;
    }
    
    /* Tighten up the responsive header - align everything on same line */
    .responsive-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important; /* Match desktop header z-index */
        background: white !important;
        padding-top: env(safe-area-inset-top, 20px) !important;
        margin-top: 0 !important;
        min-height: auto !important;
        height: auto !important;
        padding: 8px 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* Ensure profile content is properly positioned */
    .responsive-header .user-avatar.mobile {
        margin-top: 0 !important;
        padding-top: 0 !important;
        display: flex !important;
        align-items: center !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    /* Ensure profile image and text are properly aligned */
    .responsive-header .user-avatar.mobile img {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    
    .responsive-header .user-avatar.mobile .name {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }
    
    .responsive-header .user-avatar.mobile .name h4 {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
    }
    
    .responsive-header .user-avatar.mobile .name span {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11px !important;
        line-height: 1.1 !important;
        display: block !important;
    }
    
    /* Ensure all header elements are vertically centered */
    .responsive-header > * {
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Style the responsive app launcher button */
    .responsive-header .res-app-launcher {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 8px !important;
    }
    
    .responsive-header .res-app-launcher a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        background: #f8f9fa !important;
        border: 1px solid #e9ecef !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }
    
    .responsive-header .res-app-launcher a:hover {
        background: #e9ecef !important;
        transform: scale(1.05) !important;
    }
    
    .responsive-header .res-app-launcher svg {
        width: 18px !important;
        height: 18px !important;
        color: #6c757d !important;
    }
    
    /* Style the dropdown for responsive app launcher */
    .responsive-header .res-app-launcher .dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        background: white !important;
        border: 1px solid #e9ecef !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        min-width: 200px !important;
        z-index: 1000 !important;
        display: none !important;
        margin-top: 8px !important;
    }
    
    /* Show responsive app launcher dropdown when toggled via JS */
    .responsive-header .res-app-launcher.dropdown-open .dropdown {
        display: block !important;
    }
    
    /* Hover behavior only on larger screens where hover makes sense */
    @media (min-width: 769px) {
        .responsive-header .res-app-launcher:hover .dropdown {
            display: block !important;
        }
    }
    
    .responsive-header .res-app-launcher .dropdown li {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .responsive-header .res-app-launcher .dropdown li a {
        display: flex !important;
        align-items: center !important;
        padding: 12px 16px !important;
        color: #495057 !important;
        text-decoration: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        width: 100% !important;
        height: auto !important;
        font-size: 14px !important;
    }
    
    .responsive-header .res-app-launcher .dropdown li a:hover {
        background: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .responsive-header .res-app-launcher .dropdown li a i {
        margin-right: 12px !important;
        font-size: 16px !important;
        width: 16px !important;
        text-align: center !important;
    }
    
    .responsive-header .res-app-launcher .dropdown li.logout a {
        color: #dc3545 !important;
        border-top: 1px solid #e9ecef !important;
    }
    
    .responsive-header .res-app-launcher .dropdown li.logout a:hover {
        background: #dc3545 !important;
        color: white !important;
    }
    
    /* Fix for suggested communities carousel when not enough items */
    .sug-caro:not(.owl-carousel) {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .sug-caro:not(.owl-carousel) .friend-box {
        flex: 1;
        min-width: 250px;
        max-width: 300px;
    }
    
    /* Ensure content doesn't overlap with mobile UI elements */
body {
    padding-top: env(safe-area-inset-top, 20px) !important;
    /* Ensure sticky positioning works */
    overflow-x: visible !important;
    overflow-y: auto !important;
}
    
    /* Add extra padding for devices with notches/cameras */
    @supports (padding-top: env(safe-area-inset-top)) {
        .responsive-header {
            padding-top: calc(env(safe-area-inset-top) + 20px) !important;
        }
    }
    
    /* Comment styling - Compact header layout */
    .comment-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .comment-header h5 {
        margin: 0;
        font-size: 13px;
        font-weight: 600;
        flex-shrink: 0;
    }
    
    .comment-timestamp {
        color: #65676b;
        font-size: 11px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .comment-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        font-size: 12px;
        color: #65676b;
        flex-shrink: 0;
        order: 2;
        width: 100%;
        margin-top: 4px;
    }
    
    .comment-heart {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 2px 6px;
        border-radius: 8px;
        text-decoration: none;
        color: #65676b;
        font-size: 12px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .comment-heart:hover {
        background-color: #f2f3f5;
        color: #dc3545;
        text-decoration: none;
    }
    
    .comment-heart.liked {
        color: #dc3545;
    }
    
    .comment-heart.liked:hover {
        background-color: #f8d7da;
    }
    
    .heart-icon {
        font-size: 14px;
        line-height: 1;
    }
    
    .like-count {
        font-weight: 500;
        min-width: 8px;
    }
    
    .comment-actions a {
        color: #65676b;
        text-decoration: none;
        font-weight: 500;
        padding: 2px 6px;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
    }
    
    .comment-actions a:hover {
        background-color: #f2f3f5;
        color: #050505;
        text-decoration: none;
    }
    
    /* Ensure comment container has proper width */
    .commenter {
        width: 100%;
        flex: 1;
    }
    
    .commenter p {
        margin: 0;
        line-height: 1.4;
    }
    

    /* Ensure commenter width is 100% at all screen sizes */
    .commenter {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        flex: 1 !important;
    }
    
    /* Ensure comment layout works at all screen sizes */
    .comment {
        display: flex !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .comment figure {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    
    .comment figure img {
        border-radius: 50% !important;
        width: 25px !important;
        height: 25px !important;
        object-fit: cover !important;
        border: none !important;
    }
    
    /* Ensure comment images are always 25px on all screen sizes */
    .comments-area > ul li figure img {
        width: 25px !important;
        height: 25px !important;
        max-width: 25px !important;
        max-height: 25px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }
    
    /* Ensure post content images are centered and fit container (not profile images) */
    #posts-container .post-body img,
    #posts-container .user-post img:not(.comments-area img):not(figure img) {
        max-width: 100%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        object-fit: contain;
    }
    
    /* Post Images Side-by-Side Layout */
    .post-images-container {
        margin: 15px 0;
        width: 100%;
    }
    
    .post-images-row {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .post-image-item {
        flex: 1;
        position: relative;
        border-radius: 8px;
        overflow: hidden;
        background: #f8f9fa;
        min-height: 200px;
    }
    
    .post-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .post-image:hover {
        transform: scale(1.02);
    }
    
    .image-more-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        cursor: pointer;
    }
    
    .more-images-indicator {
        color: white;
        font-size: 18px;
        font-weight: 600;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .more-images-indicator i {
        font-size: 24px;
    }
    
    .more-images-indicator span {
        font-size: 14px;
    }
    
    /* Responsive adjustments */
    @media (max-width: 768px) {
        .post-images-row {
            gap: 6px;
        }
        
        .post-image-item {
            min-height: 150px;
        }
        
        .more-images-indicator {
            font-size: 16px;
        }
        
        .more-images-indicator i {
            font-size: 20px;
        }
        
        .more-images-indicator span {
            font-size: 12px;
        }
    }
    
    @media (max-width: 480px) {
        .post-images-row {
            gap: 4px;
        }
        
        .post-image-item {
            min-height: 120px;
        }
    }
    
    /* Ensure comment header layout works at all screen sizes */
    .comment-header {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-bottom: 4px !important;
        width: 100% !important;
        flex-wrap: wrap !important;
    }
    
    /* Ensure comment actions stay aligned with comment text */
    .comment-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
        order: 2 !important;
        width: 100% !important;
        margin-top: 4px !important;
    }
    
    /* Style the commenter name */
    .comment-header h5 {
        font-size: 12px;
        color: #333;
        text-decoration: none;
        margin: 0;
    }
    
    /* CRITICAL: Ensure sticky navigation works on mobile */
    #sticky-navigation {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        background: white !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        display: block !important;
        /* Override the generic section rule from style.css */
        float: none !important;
    }
    
    /* CRITICAL: Fix sidebar positioning to work with sticky navigation */
    nav.sidebar {
        z-index: 1000 !important; /* Higher than sticky navigation */
        padding-top: 120px !important; /* Reduced padding to clear headers */
    }
    
    /* Ensure sidebar appears above sticky navigation when open */
    nav.sidebar.hide {
        z-index: 1000 !important;
    }
    
    /* CRITICAL: Fix side-slide positioning and transitions */
    .side-slide {
        top: 120px !important; /* Lower position to clear headers better */
        z-index: 1000 !important; /* Higher than sticky navigation */
        transition: right 0.3s linear !important; /* Only transition the slide, not top */
    }
    
    .side-slide.active {
        top: 120px !important; /* Keep consistent when active */
        right: 0 !important; /* Ensure it slides in properly */
    }
}

@media only screen and (min-width: 813px) {
    /* Desktop: Hide responsive header, show main header */
    .responsive-header {
        display: none !important;
    }
    header {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important; /* Highest z-index for desktop header */
        background: white !important;
    }
    
    /* Adjust sticky navigation position for desktop header height */
    #sticky-navigation {
        top: 80px !important; /* Desktop header is taller */
    }
    
    /* CRITICAL: Fix side-slide positioning and transitions on desktop */
    .side-slide {
        top: 100px !important; /* Lower position to clear desktop headers */
        z-index: 1000 !important; /* Higher than sticky navigation */
        transition: right 0.3s linear !important; /* Only transition the slide, not top */
    }
    
    .side-slide.active {
        top: 100px !important; /* Keep consistent when active */
        right: 0 !important; /* Ensure it slides in properly */
    }
}

/* CRITICAL: Fix the gap between 813px and 845px */
@media only screen and (min-width: 813px) and (max-width: 845px) {
    #sticky-navigation {
        top: 80px !important; /* Ensure desktop behavior in the gap */
        position: -webkit-sticky !important;
        position: sticky !important;
        z-index: 999 !important;
        background: white !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        display: block !important;
    }
}

/* Enhanced Post Creation Modal Styles - Global */
/* Mobile-optimized popup */
.android-webview .post-new-popup .popup {
    width: 95% !important;
    max-width: 500px;
    margin: 20px auto;
    border-radius: 12px;
}

/* Facebook-style modal adjustments - Global */
.post-new-popup .popup {
    max-height: 90vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Dynamic height adjustment when content is added - Global */
.post-new-popup .popup.has-embed {
    max-height: 95vh;
    height: auto;
    min-height: 500px;
}

/* Enhanced embed styling - Facebook-like */
.embed-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    margin: 15px 0;
    border: 1px solid #e4e6ea;
    background: #fff;
    width: 100% !important;
    max-width: 100% !important;
}

/* Make embeds wider and more prominent - Facebook style */
.embed-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0;
}

.embed-wrapper iframe,
.embed-wrapper img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    display: block;
    object-fit: contain; /* Changed from cover to contain to prevent cropping */
}

/* Fix for larger screen widths - prevent image cutoff at 1146px and wider */
@media (min-width: 1146px) {
    .embed-wrapper img {
        max-width: 600px !important; /* Limit maximum width on larger screens */
        width: auto !important; /* Allow natural width up to max-width */
        margin: 0 auto !important; /* Center the image */
    }
    
    .embed-wrapper iframe {
        max-width: 100% !important; /* Keep iframes full width */
    }
}

/* Fix for medium screen widths - prevent image cutoff between 991px and 575px */
@media (min-width: 575px) and (max-width: 991px) {
    .embed-wrapper img {
        max-width: 500px !important; /* Limit maximum width on medium screens */
        width: auto !important; /* Allow natural width up to max-width */
        margin: 0 auto !important; /* Center the image */
        height: auto !important; /* Maintain aspect ratio */
    }
    
    .embed-wrapper iframe {
        max-width: 100% !important; /* Keep iframes full width */
    }
}

/* Video embeds specifically */
.video-embed {
    width: 100%;
    margin: 10px 0;
}

.video-embed iframe {
    width: 100% !important;
    height: 315px !important;
    border-radius: 12px;
    border: none;
}

/* Link preview cards - Facebook style */
.embed-wrapper a {
    text-decoration: none;
    color: inherit;
}

/* Better spacing in modal when embeds are present - Global */
#editor-container {
    min-height: 120px;
    transition: min-height 0.3s ease;
    padding: 15px;
}

#editor-container.has-embed {
    min-height: 150px;
    padding-bottom: 20px;
}

/* Better mobile navigation */
.android-webview .feed_tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.android-webview .feed_tabs::-webkit-scrollbar {
    display: none;
}

/* Quill Toolbar Styling - Global */
.ql-toolbar {
    margin-bottom: 10px; /* Add some space between the toolbar and content */
    background-color: #f5f5f5; /* Change the background color to make it blend in better */
    border-radius: 5px; /* Round the edges for a cleaner look */
}

.ql-toolbar button {
    background-color: #fff; /* Background color */
    border: none; /* Remove borders */
    padding: 8px; /* Add some padding */
    margin-right: 5px; /* Add space between buttons */
    border-radius: 3px; /* Slight rounding of button corners */
}

.ql-toolbar button:hover {
    background-color: #eee; /* Hover effect */
}

/* Spinner animation for uploads */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced embed styling - Global */
.embed-wrapper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.embed-wrapper:hover {
    transform: translateY(-2px);
}

/* Better delete button styling - Global */
.delete-embed-btn {
    transition: all 0.2s ease;
}

.delete-embed-btn:hover {
    background: rgba(0,0,0,0.9) !important;
    transform: scale(1.1);
}

/* Enhanced editor styling - Global */
#editor {
    border-radius: 8px;
    border: 1px solid #e4e6ea;
    transition: border-color 0.2s ease;
}

#editor:focus-within {
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

/* Loading states - Global */
.upload-loading {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* Notification badge styling - Global */
.notif-count {
    /* Let JavaScript control visibility */
}

/* Facebook-style Notification Layout - Override old styles */
.notificationz .notification-item,
.notification-item {
    display: flex !important;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    position: relative;
    margin-bottom: 0 !important;
    width: 100% !important;
}

/* Force override of old notification styles */
.notificationz > li.notification-item {
    display: flex !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #f0f8ff;
}

.notification-avatar-container {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Override old notification figure styles */
.notificationz .notification-item figure,
.notification-item figure {
    display: inline-block !important;
    margin-bottom: 0 !important;
    vertical-align: top !important;
    width: auto !important;
}

.notification-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reaction-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #1877f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

/* Override old mesg-info styles */
.notificationz .notification-item .mesg-info,
.notification-item .mesg-info {
    display: block !important;
    vertical-align: top !important;
    width: auto !important;
}

.notification-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    color: #1c1e21;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.notification-context {
    font-size: 12px;
    color: #1877f2;
    font-weight: 500;
    margin: 2px 0;
}

.notification-time {
    font-size: 12px;
    color: #65676b;
    font-weight: 400;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notification-delete {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #65676b;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.notification-delete:hover {
    background: #e4e6ea;
    color: #1c1e21;
}

.unread-indicator {
    width: 8px;
    height: 8px;
    background: #1877f2;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .notification-item {
        padding: 10px 12px;
    }
    
    .notification-avatar {
        width: 36px;
        height: 36px;
    }
    
    .reaction-overlay {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .notification-text {
        font-size: 13px;
    }
    
    .notification-time {
        font-size: 11px;
    }
}

/* Badge List Styling - Modern Layout */
.badges-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.badge-item {
    position: relative;
}

.badge-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.badge-wrap:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.badge-front {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.badge-front img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.badge-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    line-height: 1.3;
}

.badge-wrap:hover .badge-back {
    opacity: 1;
}

/* Responsive badge layout */
@media (max-width: 768px) {
    .badges-modern {
        gap: 10px;
        justify-content: center;
    }
    
    .badge-wrap {
        width: 70px;
        height: 70px;
    }
    
    .badge-front img {
        width: 50px;
        height: 50px;
    }
    
    .badge-back {
        font-size: 10px;
        padding: 6px;
    }
}

/* Event Preview Styling - Global */
.event-preview {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.event-preview img {
    transition: transform 0.3s ease;
}

.event-preview:hover img {
    transform: scale(1.02);
}

/* Enhanced event preview styling */
.embed-wrapper.event-preview {
    border: 1px solid #e4e6ea !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin: 10px 0 !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.embed-wrapper.event-preview a {
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
}

.embed-wrapper.event-preview .event-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    background: rgba(0,123,255,0.9) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.embed-wrapper.event-preview .event-content {
    padding: 16px !important;
}

.embed-wrapper.event-preview .event-source {
    font-size: 12px !important;
    color: #65676b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
}

.embed-wrapper.event-preview .event-title {
    font-size: 18px !important;
    line-height: 1.3 !important;
    color: #050505 !important;
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
}

.embed-wrapper.event-preview .event-details {
    font-size: 14px !important;
    color: #65676b !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
}

.embed-wrapper.event-preview .event-description {
    background: #f8f9fa !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    color: #495057 !important;
    line-height: 1.4 !important;
}


.emoji-reactors-header {
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
    margin-bottom: 8px;
    text-align: center;
}

.emoji-reactors-list {
    max-height: 200px;
    overflow-y: auto;
}

.emoji-reactor-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
}

.emoji-reactor-item:last-child {
    border-bottom: none;
}

.emoji-reactor-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0;
}

.emoji-reactor-name {
    font-size: 13px;
    color: #1c1e21;
    font-weight: 500;
}

.emoji-reactors-more {
    text-align: center;
    font-size: 12px;
    color: #65676b;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f2f5;
}

/* Fix emoji sizing and alignment on mobile screens */
@media (max-width: 812px) {
    .stat-tools .Emojis {
        left: 0 !important;            /* anchor flush to the left */
        right: auto !important;
        transform: none !important;
        z-index: 1000 !important;
    }
    .stat-tools .Emojis .Emoji {
        width: 2.4rem !important;      /* smaller emoji hitbox */
        height: 2.4rem !important;
    }
    .stat-tools .Emojis .Emoji .icon {
        transform: scale(0.5) !important; /* scale sprite to match smaller hitbox */
    }
    
    /* Fix emoji state alignment */
    .emoji-state > .popover_wrapper > a img {
        max-width: 20px !important;    /* smaller emoji state images */
        margin-left: 8px !important;   /* reduce spacing */
    }
    
    /* Ensure emoji state aligns properly with buttons */
    .emoji-state {
        margin-top: 0 !important;
        vertical-align: middle !important;
    }
    
}

/* Prevent emoji popover cutoff on very narrow phones (e.g., Fold narrow) */
@media (max-width: 480px) {
    .stat-tools .Emojis .Emoji {
        width: 2.2rem !important;      /* even smaller for very narrow screens */
        height: 2.2rem !important;
    }
    .stat-tools .Emojis .Emoji .icon {
        transform: scale(0.45) !important;
    }
}

/* Show topbar dropdown when toggled via JS on mobile */
.topbar ul.web-elements > li.dropdown-open .dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure emoji picker works in modal */
#postDetailModal .Emojis {
    background: #fff;
    position: absolute;
    left: 16px;
    bottom: 37px;
    -webkit-transform: translate3d(-6%, 0, 0);
    transform: translate3d(-6%, 0, 0);
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    border-radius: 40px;
    -webkit-transition: .3s .3s;
    transition: .3s .3s;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 2px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

#postDetailModal .Emojis:hover, 
#postDetailModal .Like__link.js-hover ~ .Emojis, 
#postDetailModal .Like__link:hover ~ .Emojis {
    -webkit-transition-delay: 0s;
    transition-delay: 0s;
    opacity: 1;
    visibility: visible;
}

#postDetailModal .Emoji {
    position: relative;
    width: 3rem;
    height: 3rem;
    color: #ffd972;
    cursor: pointer;
    border-radius: 100%;
    -webkit-transition-delay: .6s, .3s;
    transition-delay: .6s, .3s;
    -webkit-transition-duration: 0s, .3s;
    transition-duration: 0s, .3s;
    -webkit-transition-property: opacity, -webkit-transform;
    transition-property: opacity, -webkit-transform;
    transition-property: transform, opacity;
    transition-property: transform, opacity, -webkit-transform;
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0) scale(0.3);
    transform: translate3d(0, 100%, 0) scale(0.3);
}

#postDetailModal .Emojis:hover .Emoji, 
#postDetailModal .Like__link.js-hover + .Emojis .Emoji, 
#postDetailModal .Like__link:hover + .Emojis .Emoji {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
}

#postDetailModal .Emoji .icon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 100%;
    transform: scale(0.7);
    transition: transform .2s ease;
}

#postDetailModal .Emoji:hover .icon {
    transform: scale(0.75) translate3d(0, -5%, 0);
}



/* Event response button styles */
a.classic-btn.interested-btn.interested {
    background-color: #6c757d !important; /* Gray background for interested */
    color: #fff !important; /* White text */
}

/* Fix hover styling for interested button */
a.classic-btn.interested-btn:hover {
    background: #ebebeb none repeat scroll 0 0 !important;
    color: #26ACE2 !important;
}

a.classic-btn.interested-btn.interested:hover {
    background-color: #5a6268 !important; /* Darker gray on hover */
    color: #fff !important;
}

/* More specific selectors to override classic-btn styles */
a.classic-btn.event-response-btn.going {
    background-color: #28a745 !important; /* Green background for going */
    color: #fff !important; /* White text */
}

a.classic-btn.event-response-btn.going:hover {
    background-color: #218838 !important; /* Darker green on hover */
    color: #fff !important;
}

a.classic-btn.event-response-btn.not-going {
    background-color: #dc3545 !important; /* Red background */
    color: #fff !important; /* White text */
}

a.classic-btn.event-response-btn.not-going:hover {
    background-color: #c82333 !important; /* Darker red on hover */
    color: #fff !important;
}

/* ========================================
   COMMUNITY PROFILE LAYOUT FIXES
   ======================================== */

/* Make the grp-info container use flexbox for proper alignment */
.grp-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Right-align the Created/Members/Posts metadata section */
.grp-info .grp-members {
    text-align: right;
    margin-top: -20px;
    flex-shrink: 0;
}

/* Ensure search and 3 dots stay right-aligned */
.grp-info ul.more-grp-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 0;
}

/* Make sure the search container is properly aligned */
.community-search-container {
    display: inline-block;
}

/* ========================================
   HIDE BLUE CAMERA ICON ON PROFILE PICTURES
   ======================================== */

/* Hide the blue camera icons that appear on hover, but keep the black camera icons visible */
.page-communities .group-dp .edit-pp,
.page-communities .group-avatar .edit-pp,
.page-profile .group-dp .edit-pp,
.page-profile .group-avatar .edit-pp {
    /* Keep the elements visible but hide the blue hover effect */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    pointer-events: auto !important;
    position: absolute !important;
    left: 10px !important;
    top: auto !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 100% !important;
    color: #fff !important;
    cursor: pointer !important;
    line-height: 38px !important;
    text-align: center !important;
    z-index: 10 !important;
}

/* Hide the fileContainer input overlay but keep the camera icon visible */
.page-communities .group-dp .fileContainer [type="file"],
.page-communities .group-avatar .fileContainer [type="file"],
.page-profile .group-dp .fileContainer [type="file"],
.page-profile .group-avatar .fileContainer [type="file"] {
    opacity: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
}

/* Keep camera icons visible even on hover */
.page-communities .group-avatar:hover .edit-pp,
.page-communities .group-dp:hover .edit-pp,
.page-communities .edit-pp:hover,
.page-profile .group-avatar:hover .edit-pp,
.page-profile .group-dp:hover .edit-pp,
.page-profile .edit-pp:hover {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Keep fileContainer visible for camera functionality */
.page-communities .group-dp .fileContainer,
.page-profile .group-dp .fileContainer {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Additional rule to ensure it's hidden on touch devices (Android/iOS) */
@media (hover: none) and (pointer: coarse) {
    .page-communities .group-dp .edit-pp,
    .page-communities .group-avatar .edit-pp,
    .page-communities .edit-pp,
    .page-profile .group-dp .edit-pp,
    .page-profile .group-avatar .edit-pp,
    .page-profile .edit-pp {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }
    
    .page-communities .group-avatar:hover .edit-pp,
    .page-profile .group-avatar:hover .edit-pp {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* Hide any dynamically created camera buttons from iOS camera fix ONLY on profile pictures */
.page-communities .group-dp .camera-btn,
.page-communities .group-avatar .camera-btn,
.page-profile .group-dp .camera-btn,
.page-profile .group-avatar .camera-btn {
    display: none !important;
}

/* ========================================
   FACEBOOK-STYLE POST DETAIL MODAL
   ======================================== */

/* Modal Overlay */
.post-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-detail-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    margin: 5% auto auto auto; /* Move modal down from top */
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px; /* Move X button to right side */
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Modal Content Wrapper */
.modal-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Modal Content Columns - 2-column layout */
.modal-content-columns {
    display: flex;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

/* Post Image Section - Updated for 2-column layout */
.modal-image-column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-right: 1px solid #e4e6ea;
    position: relative;
}

.post-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
    padding: 15px; /* Add padding around image on laptop/desktop */
}


/* Post Details Section - Updated for 2-column layout */
.modal-details-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    min-width: 0;
}

.modal-details-column .post-content {
    min-height: auto;
    margin-bottom: 16px;
}

/* Post Author Info */
.post-author-info {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e4e6ea;
    gap: 12px;
}

.author-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    flex: 1;
    min-width: 0;
}

.author-details h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.2;
}

.post-time {
    font-size: 14px;
    color: #65676b;
    display: block;
    margin-top: 2px;
}


/* Post Content */
.post-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    border-bottom: 1px solid #e4e6ea;
}

.post-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #1c1e21;
    word-wrap: break-word;
}

/* Post Engagement */
.post-engagement {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.engagement-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #65676b;
}

.engagement-actions {
    display: flex;
    gap: 8px;
}

.engagement-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #65676b;
    transition: all 0.2s ease;
}

.engagement-btn:hover {
    background: #f0f2f5;
    color: #1c1e21;
}

.engagement-btn.active {
    color: #1877f2;
}

/* Comments Section */
.comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6ea;
}

.comments-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
}

.comments-sort {
    border: 1px solid #e4e6ea;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    color: #65676b;
    background: white;
    cursor: pointer;
}

.comments-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    max-height: 300px;
}

/* Individual Comment Styles */
.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #1c1e21;
}

.comment-time {
    font-size: 12px;
    color: #65676b;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: #1c1e21;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.comment-action {
    color: #65676b;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.comment-action:hover {
    color: #1877f2;
}

/* Add Comment Form */
.add-comment-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e4e6ea;
}

.comment-input-container {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.comment-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
}

.comment-input-wrapper textarea {
    width: 100%;
    min-height: 36px;
    max-height: 120px;
    padding: 8px 12px;
    border: 1px solid #e4e6ea;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-input-wrapper textarea:focus {
    border-color: #1877f2;
}

/* Modal comment form styling */
.modal-content-wrapper .new-comment {
    margin: 15px;
    padding: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.modal-content-wrapper .new-comment textarea {
    width: calc(100% - 60px);
    min-height: 28px;
    max-height: 80px;
    border: 1px solid #dadde1;
    border-radius: 20px;
    padding: 8px 12px;
    padding-right: 50px; /* Add right padding to prevent text from reaching edge */
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 18px;
}

.modal-content-wrapper .new-comment textarea:focus {
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}


/* Ensure modal comments show profile images correctly */
#modalCommentsContainer .comment figure {
    flex-shrink: 0 !important;
    margin: 0 !important;
    display: block !important;
}

#modalCommentsContainer .comment figure img {
    border-radius: 50% !important;
    width: 25px !important;
    height: 25px !important;
    object-fit: cover !important;
    border: none !important;
    display: block !important;
    visibility: visible !important;
}

#modalCommentsContainer .comments {
    list-style: none;
    padding: 0;
    margin: 0;
}

#modalCommentsContainer .comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0;
}

.comment-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.comment-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comment-action-btn:hover {
    background: #f0f2f5;
    color: #1c1e21;
}

.comment-submit-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.comment-submit-btn:hover:not(:disabled) {
    background: #166fe5;
    transform: scale(1.05);
}

.comment-submit-btn:disabled {
    background: #e4e6ea;
    color: #bcc0c4;
    cursor: not-allowed;
}

/* Mobile and Small Tablet Responsive Styles */
@media (max-width: 1024px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
        overflow: auto; /* Allow scrolling on mobile */
    }
    
    .modal-content-wrapper {
        display: block; /* Change from flex to block on mobile */
        overflow: visible; /* Allow natural scrolling */
        height: auto; /* Let content determine height */
    }
    
    .modal-content-columns {
        display: block; /* Change from flex to block on mobile */
        overflow: visible;
        height: auto;
    }
    
    .modal-image-column {
        width: 100%;
        height: 40vh; /* Use viewport height instead of flex */
        min-height: 250px;
        flex: none; /* Remove flex behavior */
        border-right: none;
        border-bottom: 1px solid #e4e6ea;
    }
    
    /* Add top padding to image on mobile so X button doesn't overlap */
    .modal-image-column .post-image-container img {
        padding-top: 50px; /* Extra space at top for close button */
    }
    
    .modal-details-column {
        width: 100%;
        flex: none; /* Remove flex behavior */
        padding: 15px;
    }
    
    .comments-section {
        width: 100%;
        flex: none; /* Remove flex behavior */
        min-height: 300px; /* Ensure adequate space for comments */
    }
    
    .modal-close {
        top: 10px;
        right: 10px; /* Move X button to right side on mobile too */
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    
    .post-author-info {
        padding: 15px;
    }
    
    .author-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-engagement {
        padding: 12px 15px;
    }
    
    .comments-header {
        padding: 12px 15px;
    }
    
    .comments-container {
        padding: 0 15px;
        max-height: none; /* Remove height restriction on mobile */
        overflow: visible; /* Allow natural flow */
        margin-bottom: 20px; /* Add space before comment form */
    }
    
    .add-comment-form {
        padding: 15px;
        background: white;
        border-top: 1px solid #eee;
        position: relative; /* Change from sticky to relative */
        width: 100%;
    }
}

/* Large Desktop Styles */
@media (min-width: 1025px) {
    .modal-container {
        width: 95%;
        height: 85%;
        max-height: 700px;
    }
    
    .modal-content-columns {
        display: flex !important;
        flex-direction: row !important;
    }
    
    .modal-image-column {
        flex: 1 !important;
        display: flex !important;
    }
    
    .modal-details-column {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .comments-container {
        max-height: 300px;
    }
}

/* Highlighting Styles */
.main-wraper.highlighted,
.post-item.highlighted,
.comment-item.highlighted {
    background-color: rgba(24, 119, 242, 0.1);
    border-radius: 8px;
    transition: background-color 0.3s ease;
    border-left: 4px solid #1877f2 !important;
    box-shadow: 0 0 10px rgba(24, 119, 242, 0.3);
}

.main-wraper.highlighted {
    border-left: 4px solid #1877f2 !important;
}

.post-item.highlighted {
    border-left: 4px solid #1877f2;
}

.comment-item.highlighted {
    border-left: 3px solid #1877f2;
    margin-left: -20px;
    padding-left: 20px;
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.post-detail-modal.active .modal-container {
    animation: modalSlideIn 0.3s ease;
}

/* Loading states */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #65676b;
}

.modal-loading i {
    font-size: 24px;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
}

/* Ensure the profile pictures themselves are still clickable and styled properly */
.page-communities .group-dp,
.page-profile .group-dp {
    position: relative;
    /* Move profile image higher up to overlap cover image more */
    margin-top: -50px;
    top: 0;
}

.page-communities .group-dp img,
.page-profile .group-dp img {
    cursor: pointer;
    border-radius: 50%;
    transition: opacity 0.3s ease;
    /* Ensure proper positioning */
    position: relative;
    top: 0;
    left: 0;
}

.page-communities .group-dp img:hover,
.page-profile .group-dp img:hover {
    opacity: 0.8;
}

/* Fix any layout issues caused by removing camera icon elements */
.page-communities .group-avatar,
.page-profile .group-avatar {
    position: relative;
}

.page-communities .group-avatar figure,
.page-profile .group-avatar figure {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Invite Member Suggestions Styling */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-option {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.autocomplete-option:hover {
    background-color: #f8f9fa;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.following-option {
    background-color: #f0f8ff;
}

.following-option:hover {
    background-color: #e6f3ff;
}

.suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.suggestion-username {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.general-option {
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
}

.no-suggestions-message {
    padding: 20px;
    text-align: center;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 8px;
}

.no-suggestions-message i {
    font-size: 24px;
    color: #6c757d;
    margin-bottom: 8px;
    display: block;
}

.no-suggestions-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Ensure proper positioning for invite entries */
.invite-entry {
    position: relative;
}

.invite-entry .form-control {
    padding-right: 40px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 250px;
    }
    
    .suggestion-avatar {
        width: 28px;
        height: 28px;
    }
    
    .suggestion-name {
        font-size: 13px;
    }
    
    .suggestion-username {
        font-size: 11px;
    }
}

/* Fix emoji popover flickering by overriding conflicting styles */
.emoji-state .popover_content {
    visibility: hidden !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

.emoji-state .popover_wrapper:hover .popover_content {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translate(0, -10px) !important;
}
