/* ============================================
   MOBILE HEADER & SIDEBAR STYLES
   ============================================ */

/* Universal Box Sizing for Mobile - Prevent overflow */
@media (max-width: 1200px) {
    * {
        box-sizing: border-box !important;
    }
    
    *:before,
    *:after {
        box-sizing: border-box !important;
    }
}

/* Mobile Header - Fixed Top */
.mobile-header {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px; /* Increased from 60px */
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    border-bottom: 2px solid #faaf3a;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 12px 20px; /* Increased vertical and horizontal padding */
    max-width: 100%;
}

.mobile-logo img {
    height: 46px; /* Slightly increased */
    width: auto;
}

/* Hamburger Menu Icon */
.mobile-menu-toggle {
    width: 44px; /* Slightly larger touch target */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px; /* Add rounded corners */
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #f5f5f5;
}

.hamburger-icon {
    width: 28px;
    height: 22px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:active .hamburger-icon span {
    background: #faaf3a;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    z-index: 1100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    -webkit-overflow-scrolling: touch;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-content {
    padding: 20px 15px;
    padding-bottom: 60px; /* Extra space at bottom */
}

/* Close Button */
.mobile-sidebar-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    color: #333;
    z-index: 10;
}

.mobile-sidebar-close:hover {
    background: #faaf3a;
    color: #fff;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* Sidebar Sections */
.mobile-sidebar-section {
    width: 100%;
}

.mobile-user-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.mobile-user-info .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin: 0 auto;
}

.mobile-user-info .smalltitle {
    font-size: 18px !important;
    margin-bottom: 10px;
    text-align: center;
}

.mobile-user-info .userpanellink {
    text-align: center;
    padding-left: 0 !important;
}

.mobile-user-info .userpanellink a {
    display: block;
    padding: 8px 0;
    font-size: 14px !important;
}

.mobile-menu-items {
    margin: 20px 0;
}

.mobile-menu-items .menuitem {
    margin-bottom: 5px;
}

.mobile-menu-items .menuitem a {
    display: block;
    padding: 12px 15px;
    font-size: 16px !important;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.2s;
}

.mobile-menu-items .menuitem.active a,
.mobile-menu-items .menuitem a:hover {
    background: #faaf3a;
    color: #fff;
}

/* Search Form in Sidebar */
.mobile-sidebar .topsearchform {
    margin-bottom: 20px;
}

.mobile-sidebar .topsearchform input {
    font-size: 14px !important;
}

/* Allergist Search in Sidebar */
.mobile-sidebar .allersearch {
    margin: 20px 0;
}

.mobile-sidebar .allersearch input {
    font-size: 14px !important;
}

.mobile-sidebar .allersearch .submit {
    font-size: 14px !important;
}

/* QR Code */
.mobile-sidebar .qr {
    text-align: center;
    margin: 20px 0;
}

.mobile-sidebar .qr svg {
    max-width: 200px !important;
    height: auto !important;
}

/* App Store Links */
.mobile-sidebar .blockcont img {
    border-radius: 8px;
}

/* Prevent body scroll when sidebar is open */
body.mobile-sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Better touch targets for mobile */
.mobile-sidebar a,
.mobile-sidebar button,
.mobile-sidebar input[type="submit"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Form improvements for mobile */
.mobile-sidebar input[type="text"],
.mobile-sidebar input[type="email"],
.mobile-sidebar input[type="password"] {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 10px;
    border-radius: 5px;
}

.mobile-sidebar button,
.mobile-sidebar .btn {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 5px;
}

/* Desktop - Hide Mobile Elements */
@media (min-width: 1201px) {
    .mobile-header {
        display: none !important;
    }
    
    .mobile-sidebar {
        display: none !important;
    }
    
    .mobile-overlay {
        display: none !important;
    }
}

/* Mobile - Show Mobile Elements & Hide Desktop Header */
@media (max-width: 1200px) {
    .mobile-header {
        display: block !important;
    }
    
    /* Hide desktop header */
    .header {
        display: none !important;
    }
    
    /* ===== FIX HORIZONTAL SCROLL ===== */
    
    /* Override container fixed width */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 0px !important;
        overflow-x: hidden !important;
    }
    
    /* Fix fullscreen container */
    .fullscreen .container {
        min-width: 100% !important;
        width: 100% !important;
    }
    
    /* Add padding to content for fixed header */
    .content.container {
        padding-top: 85px !important; /* Increased from 70px to match new header height */
        margin-top: 0 !important;
    }
    
    /* Prevent horizontal overflow on body and html */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* Left sidebar should be hidden on mobile (handled by desktop-only class) */
    .sidebar.desktop-only {
        display: none !important;
    }
    
    /* Make content full width on mobile */
    #maincontent {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 0px !important;
        float: none !important;
        overflow-x: hidden !important;
    }
    
    /* All rows should not overflow */
    .row {
        margin-left: -15px !important;
        margin-right: -15px !important;
        max-width: 100% !important;
    }
    
    /* Adjust footer for mobile */
    .footer {
        margin-top: 30px !important;
        overflow-x: hidden !important;
    }
    
    /* Improve readability on mobile */
    body {
        font-size: 16px !important; /* Optimal reading size for mobile */
        line-height: 1.5;
    }
    
    /* Better typography for mobile */
    .smalltitle {
        font-size: 18px !important;
        line-height: 1.4;
    }
    
    .thecomment {
        font-size: 16px !important;
        line-height: 1.6;
    }
    
    .comtaction {
        font-size: 14px !important;
    }
    
    /* Sign in menu remains small */
    .signinmenu {
        font-size: 14px !important;
    }
    
    /* Ensure text is readable but not too large */
    p, span, div {
        font-size: inherit;
        line-height: 1.5;
    }
    
    /* Headings scaled appropriately */
    h1, .h1 { font-size: 24px !important; }
    h2, .h2 { font-size: 22px !important; }
    h3, .h3 { font-size: 20px !important; }
    h4, .h4 { font-size: 18px !important; }
    h5, .h5 { font-size: 16px !important; }
    h6, .h6 { font-size: 14px !important; }
    
    /* Make sure panels and notifications work on mobile */
    .quickpanel {
        top: 70px !important; /* Below mobile header - adjusted for new height */
    }
    
    /* ===== FIX TABLES & LARGE CONTENT ===== */
    
    /* Make tables responsive with horizontal scroll */
    table {
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap;
    }
    
    /* Wrapper for tables that need scroll */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Item list tables */
    .itemlisttable {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100% !important;
    }
    
    .itemlisttable li {
        min-width: 100% !important;
    }
    
    /* Dashboard and panels */
    .dashboardwrap,
    .panelbox,
    .blockcont {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Posts and content blocks */
    .post,
    .postcont,
    .article {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Pre and code blocks */
    pre, code {
        max-width: 100% !important;
        overflow-x: auto !important;
        word-wrap: break-word !important;
        white-space: pre-wrap !important;
    }
    
    /* ===== FIX IMAGES & MEDIA ===== */
    
    /* All images should be responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    /* Inline images */
    img[style*="float"] {
        max-width: 50% !important;
    }
    
    /* Background images containers */
    .avatar,
    .banner,
    [style*="background-image"] {
        max-width: 100% !important;
    }
    
    /* Video and iframes */
    iframe,
    video,
    embed,
    object {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* ===== FIX FORMS & INPUTS ===== */
    
    /* All form inputs should be full width */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="number"],
    textarea,
    select {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Form groups */
    .form-group,
    .form-control,
    .input-group {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Buttons should fit container */
    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        max-width: 100% !important;
    }
    
    /* Select dropdowns */
    select,
    .selectwrap {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* ===== FIX SPECIFIC ELEMENTS WITH FIXED WIDTH ===== */
    
    /* Headers and navigation */
    .header,
    .navbar,
    .nav,
    .menu {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Columns should stack on mobile */
    [class*="col-"] {
        max-width: 100% !important;
        /* padding-left: 15px !important;
        padding-right: 15px !important; */
    }
    
    /* Modals */
    .modal-dialog,
    .modal-content {
        max-width: 95% !important;
        margin: 10px auto !important;
    }
    
    /* Alerts and messages */
    .alert,
    .message,
    .notification {
        max-width: 100% !important;
        word-wrap: break-word !important;
    }
    
    /* Cards and boxes */
    .card,
    .box,
    .panel {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Search forms */
    .search-form,
    .search-container,
    .topsearchform {
        max-width: 100% !important;
    }
    
    /* Profile and user panels */
    .profile,
    .userpanel,
    .userinfo {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Calendar and date pickers */
    .calendar,
    .datepicker,
    .fc {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Charts */
    canvas,
    .chart-container {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Inline elements with fixed width */
    [style*="width"] {
        max-width: 100% !important;
    }
    
    /* QR Codes and barcodes */
    .qr svg,
    .barcode {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Lists */
    ul, ol {
        padding-left: 20px !important;
        max-width: 100% !important;
    }
    
    /* Divs with specific classes that might overflow */
    .content-wrapper,
    .main-content,
    .page-content,
    .wrapper {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* ===== TEXT & WORD WRAPPING ===== */
    
    /* Ensure long text wraps properly */
    p, span, div, a, li, td, th {
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Prevent long URLs from causing overflow */
    a[href] {
        word-break: break-all !important;
    }
    
    /* Headings should wrap */
    h1, h2, h3, h4, h5, h6,
    .h1, .h2, .h3, .h4, .h5, .h6 {
        word-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* ===== ADDITIONAL FIXES ===== */
    
    /* Float elements shouldn't cause overflow */
    .float-left,
    .float-right,
    [style*="float"] {
        max-width: 48% !important;
    }
    
    /* Clear floats properly */
    .clearfix:after,
    .clear:after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Sidebar elements in main content */
    .sidebar-widget,
    .widget {
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Breadcrumbs */
    .breadcrumb {
        max-width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Pagination */
    .pagination {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    /* Tooltips and popovers */
    .tooltip,
    .popover {
        max-width: 90% !important;
    }
    
    /* ===== FIX POST/COMMENT ALIGNMENT ===== */
    
    /* Post actions alignment */
    .postaction {
        padding: 15px 0 !important;
        margin-top: 15px !important;
    }
    
    .postaction .theaction {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    .postaction span {
        display: inline-flex !important;
        align-items: center !important;
        margin-right: 0 !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    .postaction span:before {
        margin-right: 6px !important;
        font-size: 16px !important;
        vertical-align: middle !important;
    }
    
    /* Number alignment */
    .postaction .thenumber {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 15px !important;
    }
    
    .postaction .thenumber span {
        display: inline-flex !important;
        align-items: center !important;
    }
    
    /* Comment actions alignment */
    .comtaction {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 12px !important;
        margin-top: 12px !important; /* More space from comment text */
        padding-top: 8px !important; /* Additional visual separation */
        font-size: 13px !important;
    }
    
    .comtaction span {
        display: inline-flex !important;
        align-items: center !important;
        margin-right: 0 !important;
        line-height: 1.4 !important;
    }
    
    .comtaction span:before {
        margin-right: 4px !important;
        vertical-align: middle !important;
    }
    
    .comtaction .time {
        color: #999 !important;
        font-size: 12px !important;
    }
    
    /* Comment list alignment */
    .commentlist {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .commentlist li {
        margin-bottom: 20px !important;
        padding: 20px 15px !important; /* Consistent padding all around */
        background: #fff;
        border: 1px solid #e1e1e1;
        border-radius: 8px;
        /* Don't use flex on li - it conflicts with Bootstrap grid inside */
    }
    
    /* Fix Bootstrap grid columns to work properly on mobile */
    .commentlist li .col-xs-1 {
        width: auto !important;
        padding: 0 !important;
        margin-right: 12px !important;
        flex-shrink: 0;
        display: block !important; /* Ensure avatar container is visible */
    }
    
    .commentlist li .col-xs-11 {
        width: auto !important;
        flex: 1;
        padding: 0 !important;
        min-width: 0; /* Prevent overflow */
    }
    
    /* Make the row behave as flex container */
    .commentlist li > .row,
    .commentlist li:not(:has(.row)) {
        display: flex !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        margin: 0 !important;
    }
    
    /* Comment content wrapper */
    .thecomment {
        padding: 0 !important;
        line-height: 1.6 !important;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    /* Comment content container */
    .comtcont {
        flex: 1;
        min-width: 0; /* Prevent text overflow */
    }
    
    /* Hide comment menu and owner actions on mobile for more space */
    .commentmenu,
    .comtmenu,
    .comment-menu,
    .owneractionswitch,
    .comtowneraction {
        display: none !important;
    }
    
    /* Avatar in comments - Square style like desktop */
    .commentlist .avatar,
    .postcomment .avatar {
        display: block !important; /* Must be visible */
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        flex-shrink: 0;
        border-radius: 4px !important; /* Square with slight rounding */
        overflow: hidden;
        background-size: cover !important;
        background-position: center !important;
        border: 1px solid #e1e1e1 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    }
    
    /* Avatar image */
    .commentlist .avatar img,
    .postcomment .avatar img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px;
    }
    
    /* Ensure proper spacing in comment content */
    .commentlist .comtcont > * {
        margin-bottom: 8px !important;
    }
    
    .commentlist .comtcont > *:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Comment reply container */
    .commentreply {
        margin-top: 12px !important;
        padding-top: 12px !important;
    }
    
    .commentreply > .row {
        margin: 0 !important;
    }
    
    /* Reply/nested comments */
    .commentlist .commentlist {
        margin-top: 20px !important;
        margin-left: 0 !important;
        padding-left: 30px !important; /* Clear indentation */
        border-left: 3px solid #e1e1e1;
    }
    
    .commentlist .commentlist .avatar {
        display: block !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        border-radius: 4px !important;
    }
    
    .commentlist .commentlist li {
        margin-bottom: 15px !important;
        padding: 16px 12px !important; /* Slightly smaller padding for nested */
    }
    
    /* Fix Bootstrap grid columns for nested comments */
    .commentlist .commentlist li .col-xs-1 {
        margin-right: 10px !important;
        display: block !important;
    }
    
    /* Post author avatar - Square style */
    .post .userinfo .avatar,
    .post .posthead .avatar {
        display: block !important;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        border-radius: 4px !important; /* Square with slight rounding */
        overflow: hidden;
        border: 1px solid #e1e1e1 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
        margin-right: 15px !important;
    }
    
    .post .userinfo .avatar img,
    .post .posthead .avatar img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px;
    }
    
    /* Username */
    a.username,
    .username {
        display: block !important; /* Block for proper spacing */
        margin-bottom: 10px !important; /* Visual separation from content */
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #333 !important;
        line-height: 1.3 !important;
    }
    
    /* Small title (like doctor name) */
    .smalltitle {
        margin-bottom: 10px !important; /* Consistent spacing */
        display: block !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }
    
    .smalltitle a {
        color: #333 !important;
        text-decoration: none;
    }
    
    /* Post user info with avatar - Square style */
    .postinfo .avatar {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        border-radius: 4px !important; /* Square with slight rounding */
        overflow: hidden;
        margin-right: 12px;
        border: 1px solid #e1e1e1 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    }
    
    .postinfo .avatar img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px;
    }
    
    /* User info container */
    .userinfo {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }
    
    /* Small title (user name in posts) */
    .smalltitle {
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
    }
    
    /* Social share icons alignment */
    .postaction .fa,
    .postaction i {
        vertical-align: middle !important;
        margin-right: 5px !important;
    }
    
    /* View more comments */
    .viewmorecomt {
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid #e1e1e1;
        font-size: 14px !important;
    }
    
    /* Post container */
    .post {
        padding: 20px 15px !important;
        margin-bottom: 20px !important; /* More space between posts */
        background: #fff;
        border: 1px solid #e1e1e1;
        border-radius: 8px;
    }
    
    /* Post form (create new post) */
    .articleform.postform > .row,
    .postform > .row {
        display: flex !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        margin: 0 0 15px 0 !important;
    }
    
    .articleform.postform .col-xs-2,
    .postform .col-xs-2 {
        width: auto !important;
        padding: 0 !important;
        margin-right: 12px !important;
        flex-shrink: 0;
        display: block !important;
    }
    
    .articleform.postform .col-xs-2 .avatar,
    .postform .col-xs-2 .avatar {
        display: block !important;
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        border-radius: 4px !important;
        background-size: cover !important;
        background-position: center !important;
        border: 1px solid #e1e1e1 !important;
    }
    
    .articleform.postform .col-xs-10,
    .postform .col-xs-10 {
        width: auto !important;
        flex: 1;
        padding: 0 !important;
        min-width: 0;
    }
    
    .articleform.postform textarea,
    .postform textarea {
        width: 100% !important;
        min-height: 80px !important;
        padding: 12px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
    }
    
    /* Post header with avatar (col-xs-2 + col-xs-10) */
    .blockpost > .row {
        display: flex !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        margin: 0 0 15px 0 !important;
    }
    
    .blockpost > .row > .col-xs-2 {
        width: auto !important;
        padding: 0 !important;
        margin-right: 12px !important;
        flex-shrink: 0;
        display: block !important; /* Ensure it's visible */
    }
    
    .blockpost > .row > .col-xs-10 {
        width: auto !important;
        flex: 1;
        padding: 0 !important;
        min-width: 0;
    }
    
    /* Ensure avatar in post is visible */
    .blockpost > .row > .col-xs-2 .avatar {
        display: block !important;
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        border-radius: 4px !important;
        background-size: cover !important;
        background-position: center !important;
        border: 1px solid #e1e1e1 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    }
    
    .blockpost > .row > .col-xs-2 .avatar img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px;
    }
    
    /* Review list - similar structure */
    .reviewlist .row.user {
        display: flex !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        margin: 0 0 15px 0 !important;
    }
    
    .reviewlist .col-xs-1 {
        width: auto !important;
        padding: 0 !important;
        margin-right: 12px !important;
        flex-shrink: 0;
        display: block !important;
    }
    
    .reviewlist .col-xs-1 .avatar {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        border-radius: 4px !important;
        background-size: cover !important;
        background-position: center !important;
        border: 1px solid #e1e1e1 !important;
    }
    
    .reviewlist .col-xs-11 {
        width: auto !important;
        flex: 1;
        padding: 0 !important;
        min-width: 0;
    }
    
    .postdetail {
        margin-bottom: 18px !important; /* More spacing */
        line-height: 1.6;
    }
    
    /* Post info (location, time) */
    .postinfo {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 10px !important;
        font-size: 13px !important;
        margin-top: 8px !important;
    }
    
    .postinfo span {
        display: inline-flex !important;
        align-items: center !important;
    }
    
    /* Post comment section */
    .postcomment {
        margin: 20px -15px 0 -15px !important; /* Space from post content */
        padding: 25px 15px !important; /* More padding */
        background: #f9f9f9;
        border-top: 1px solid #e1e1e1;
    }
    
    /* Post comment form - flex layout for Bootstrap grid */
    .postcommentform {
        display: flex !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        margin-top: 15px !important;
    }
    
    .postcommentform .col-xs-1 {
        width: auto !important;
        padding: 0 !important;
        margin-right: 12px !important;
        flex-shrink: 0;
        display: block !important;
    }
    
    .postcommentform .col-xs-1 .avatar {
        display: block !important;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 4px !important;
        background-size: cover !important;
        background-position: center !important;
        border: 1px solid #e1e1e1 !important;
    }
    
    .postcommentform .col-xs-11 {
        width: auto !important;
        flex: 1;
        padding: 0 !important;
        min-width: 0;
    }
    
    /* Comment form */
    .commentform {
        width: 100%;
    }
    
    .commentform textarea,
    .commentform input[type="text"] {
        font-size: 15px !important;
        padding: 12px !important;
        border-radius: 8px !important;
        width: 100%;
    }
    
    /* Fix specific alignment issues from the image */
    
    /* Ensure LIKE, ANSWER, REPORT buttons are on same line and aligned */
    .postaction > .row {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }
    
    .postaction .col-xs-8,
    .postaction .col-xs-4 {
        display: flex !important;
        align-items: center !important;
    }
    
    /* Icon before text should be vertically centered */
    .postaction span.like:before,
    .postaction span.comment:before,
    .postaction span.report:before,
    .postaction span.share:before {
        display: inline-block !important;
        vertical-align: middle !important;
        line-height: 1 !important;
    }
    
    /* Numbers in post actions */
    .postaction .thenumber span:before {
        font-size: 14px !important;
    }
    
    /* Comment like number */
    .comtaction span.comtlikenum {
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .comtaction span.comtlikenum:before {
        font-size: 13px !important;
    }
    
    /* Social media icons in post actions */
    .postaction a[href*="facebook"],
    .postaction a[href*="twitter"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5px !important;
    }
}

/* Extra Small Devices */
@media (max-width: 768px) {
    .mobile-sidebar {
        width: 90%;
        max-width: 300px;
    }
    
    .mobile-logo img {
        height: 42px; /* Adjusted for smaller screens */
    }
    
    .mobile-header {
        height: 64px; /* Adjusted height for small screens */
    }
    
    .mobile-header-container {
        padding: 10px 15px; /* Adjusted padding */
    }
    
    /* Slightly smaller font for very small screens */
    body {
        font-size: 15px !important;
    }
    
    h1, .h1 { font-size: 22px !important; }
    h2, .h2 { font-size: 20px !important; }
    h3, .h3 { font-size: 18px !important; }
    
    .content.container {
        padding-top: 78px !important; /* Adjusted for new header height */
    }
    
    .quickpanel {
        top: 64px !important; /* Adjusted */
    }
    
    /* Smaller avatars on very small screens but still visible */
    .commentlist .avatar,
    .postcomment .avatar {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
    }
    
    .postinfo .avatar {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
    }
}

/* Smooth Animations */
@keyframes slideIn {
    from {
        left: -100%;
    }
    to {
        left: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Rating stars in mobile sidebar */
.mobile-sidebar .rating {
    text-align: center;
    margin: 10px 0;
}

.mobile-sidebar .rating i {
    font-size: 16px;
}

/* Adjust blockcont spacing in mobile */
.mobile-sidebar .blockcont {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.mobile-sidebar .blockcont p {
    font-size: 14px !important;
    line-height: 1.6;
    margin-bottom: 10px !important;
}

/* Sidebar banner */
.mobile-sidebar .sidebanner {
    padding: 0;
    background: transparent;
}

.mobile-sidebar .sidebanner img {
    border-radius: 8px;
}

/* Box styling */
.mobile-sidebar .box {
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.mobile-sidebar .box.hightlight {
    background: #faaf3a;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 12px;
}

