
:root {
  --brand-blue: #0055A4;
  --brand-yellow: #fca311;
  /* ✅ FIX: Solid white background for the new "floating" card look */
  --sidebar-bg: #ffffff;
  /* ✅ FIX: Dark grey text for high contrast and readability */
  --sidebar-text: #6c757d;
  /* ✅ FIX: Using your brand blue for hover/active text for a premium feel */
  --sidebar-text-hover: #0055A4;
  /* ✅ FIX: A very light blue background for hover/active states */
  --sidebar-active-bg: rgba(0, 85, 164, 0.08);
  --main-bg: #F4F7F6;
  --card-bg: #FFFFFF;
  --primary-text: #333333;
  --secondary-text: #6c757d;
  --border-color: #e5e7eb;
  --primary-dark: #2c3e50;
  --text-light: #ecf0f1;
  --sidebar-width: 260px;
  --bottom-nav-height: 75px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-y: scroll; scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--main-bg); color: var(--primary-text); }
a { text-decoration: none; color: inherit; }


/* --- 2. DESKTOP-FIRST LAYOUT & SIDEBAR (UNIQUE NEW SHAPE) --- */
.page-layout { 
    display: flex;
    /* ✅ NEW SHAPE: Added padding to make space for the floating sidebar */
    padding-left: calc(var(--sidebar-width) + 40px);
}

.sidebar {
    /* ✅ NEW SHAPE: Changed from sticky to fixed to allow it to "float" */
    position: fixed; 
    /* ✅ NEW SHAPE: Added top and left values to inset it from the page edge */
    top: 20px;
    left: 20px;
    /* ✅ NEW SHAPE: Made height less than 100% of the screen */
    height: calc(100vh - 40px);
    /* ✅ NEW SHAPE: Added large rounded corners */
    border-radius: 24px;
    /* ✅ NEW SHAPE: Added a modern shadow to make it pop */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* --- Unchanged properties below --- */
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease-in-out;
    /* backdrop-filter is no longer needed with a solid background */
}

.sidebar-main-content { display: flex; flex-direction: column; flex-grow: 1; }
.sidebar-header { padding: 25px 0 15px 0; text-align: center; border-bottom: 1px solid var(--border-color); }
.sidebar-header .logo-image { height: 110px; width: 110px; object-fit: cover; border-radius: 22px; border: 2px solid var(--brand-yellow); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transition: all 0.3s ease-in-out; }
.sidebar-header .logo-image:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); filter: drop-shadow(0 0 10px rgba(252, 163, 17, 0.7)); }
.sidebar-nav { flex-grow: 1; overflow-y: auto; padding: 15px 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav > ul > li { position: relative; }
.sidebar-nav ul a { color: var(--sidebar-text); display: flex; align-items: center; padding: 14px 26px; font-size: 0.95rem; font-weight: 500; margin: 0 15px 5px; border-radius: 8px; position: relative; overflow: hidden; transition: all 0.2s ease-in-out; }
.sidebar-nav ul a::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 4px; background-color: var(--brand-yellow); transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.sidebar-nav ul a i { margin-right: 20px; font-size: 1.1rem; width: 20px; text-align: center; transition: all 0.2s ease; }
.sidebar-nav ul a span { flex-grow: 1; }
.sidebar-nav ul a:hover { background: var(--sidebar-active-bg); color: var(--sidebar-text-hover); }
.sidebar-nav ul a:hover::before { transform: translateX(0); }
.sidebar-nav ul a.active { background: var(--sidebar-active-bg); color: var(--sidebar-text-hover); font-weight: 600; }
.sidebar-nav ul a.active::before { transform: translateX(0); }
.sidebar-nav li.open > a { color: var(--sidebar-text-hover); background: var(--sidebar-active-bg); }
.sidebar-nav .submenu { padding-left: 35px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; z-index: 201; position: relative; }
.sidebar-nav li.open .submenu { max-height: 200px; padding-top: 5px; padding-bottom: 5px; }
.sidebar-nav li.open > a .fa-chevron-down { transform: rotate(180deg); color: var(--sidebar-text-hover); }
.sidebar-nav .submenu a { font-size: 0.9rem; padding: 10px 15px; margin-right: 15px; border-left: none; }
.sidebar-nav .submenu a::before { display: none; }
.sidebar-nav .submenu a.active { color: var(--brand-yellow); font-weight: 600; background: none; }
.sidebar-footer { padding: 15px; border-top: 1px solid var(--border-color); position: relative; }
.user-menu-toggle { display: flex; align-items: center; padding: 10px 15px; border-radius: 8px; cursor: pointer; transition: background 0.2s ease; }
.user-menu-toggle:hover { background: var(--sidebar-active-bg); }
/* ✅ FIX: Made footer icons and text dark and readable */
.user-menu-toggle i { color: var(--primary-dark); }
.user-menu-toggle i:first-child { font-size: 1.5rem; margin-right: 15px; }
.user-menu-toggle span { font-weight: 600; color: var(--primary-dark); }
.user-menu-toggle .fa-chevron-up { margin-left: auto; transition: transform 0.3s ease; }
.sidebar-footer.open .user-menu-toggle .fa-chevron-up { transform: rotate(180deg); }
.user-dropdown { position: absolute; bottom: calc(100% + 5px); left: 15px; right: 15px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 -4px 15px rgba(0,0,0,0.1); padding: 8px; z-index: 210; visibility: hidden; opacity: 0; transform: translateY(10px); transition: all 0.2s ease-out; }
.sidebar-footer.open .user-dropdown { visibility: visible; opacity: 1; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; padding: 12px 15px; border-radius: 6px; font-size: 0.9rem; color: var(--sidebar-text); transition: all 0.2s ease-in-out; }
.user-dropdown a:hover { background: var(--sidebar-active-bg); color: var(--sidebar-text-hover); }
.user-dropdown a i { width: 20px; margin-right: 15px; }
.bottom-nav { display: none; }

/* --- 3. MAIN CONTENT STYLES (INCLUDES ALL PAGES) --- */
.main-content { flex-grow: 1; width: 100%; padding: 30px 40px; }
.main-content .container { display: flex; flex-direction: column; gap: 2.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.mobile-back-button { display: none; }
.page-title { font-size: 2.2rem; font-weight: 700; color: var(--primary-dark); margin: 0; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.filter-container { position: relative; }
.filter-container select { border: 1px solid #dcdcdc; border-radius: 8px; padding: 0.7rem 1rem; font-family: 'Poppins', sans-serif; font-size: 0.9rem; background-color: #fff; height: 46px; transition: all 0.2s ease; -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 2.5rem; }
.filter-container::after { content: '\f078'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--secondary-text); }
.search-container { display: flex; }
.search-container input { border: 1px solid #dcdcdc; padding: 0.7rem 1rem; height: 46px; border-top-left-radius: 8px; border-bottom-left-radius: 8px; border-right: none; min-width: 220px; }
.search-container button { padding: 0 1rem; border: 1px solid #dcdcdc; background-color: #f8f9fa; border-top-right-radius: 8px; border-bottom-right-radius: 8px; cursor: pointer; color: var(--secondary-text); height: 46px; }
.filter-container select:focus, .search-container input:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(0, 85, 164, 0.2); }
.btn-create { display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem; padding: 0 1.5rem; background: var(--brand-yellow); color: var(--primary-dark); text-decoration: none; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; white-space: nowrap; transition: all 0.3s ease; height: 46px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); }
.btn-create:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(252, 163, 17, 0.4); }
.btn-create i { font-size: 0.8em; transition: transform 0.3s ease; }
.btn-create:hover i { transform: rotate(90deg); }
/* --- Polished Item Card Styles --- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface); /* Use unified variable */
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-secondary); /* Use unified variable */
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother cubic-bezier transition */
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06); /* Softer base shadow */
}

.item-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.06); /* Refined hover shadow */
}

/* ✅ REFINEMENT 1: Add a subtle border to the image */
.item-card .card-image-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--bg-input); /* Use unified variable */
    border-bottom: 1px solid var(--border-color); /* Separates image from text */
}

.item-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.item-card:hover .card-image {
    transform: scale(1.05);
}

.item-card .card-body {
    padding: 1.25rem; /* Standardized padding */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-card .card-title {
    font-size: 1.15rem; /* Slightly smaller for better balance */
    font-weight: 600;
    margin: 0 0 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
    color: var(--text-primary); /* Use unified variable */
}

/* ✅ REFINEMENT 2: Improve metadata readability */
.item-card .card-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Consistent gap */
    font-size: 0.875rem; /* Standard size for secondary info */
    color: var(--text-secondary);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ✅ REFINEMENT 3: Make icons more distinct */
.card-meta i {
    width: 16px;
    text-align: center;
    color: var(--brand-primary); /* Use a brand color for icons */
    opacity: 0.7; /* Soften the icon color slightly */
}
.item-status { position: absolute; top: 1rem; left: 1rem; padding: 6px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #fff; z-index: 2; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.2); }
.item-status.lost { background-color: rgba(231, 76, 60, 0.8); }
.item-status.found { background-color: rgba(46, 204, 113, 0.8); }
.empty-state-container { grid-column: 1 / -1; text-align: center; padding: 4rem 2rem; background: #fff; border-radius: 12px; border: 1px dashed var(--border-color); }
.empty-state-container h3 { font-size: 1.5rem; color: var(--primary-text); margin-bottom: 0.5rem; }
.empty-state-container p { color: var(--secondary-text); margin-bottom: 1.5rem; max-width: 400px; margin-left: auto; margin-right: auto; }
.single-wrapper { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2.5rem; align-items: start; }
.panel { background: #fff; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 10px 20px rgba(0,0,0,0.03); padding: 1.5rem; }
#main-post-image { width: 100%; height: auto; max-height: 600px; object-fit: contain; border-radius: 8px; margin-bottom: 1rem; background: #f8f9fa; }
.thumbnail-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbnail-img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 3px solid transparent; transition: all 0.2s ease; }
.thumbnail-img:hover { border-color: #ccc; }
.thumbnail-img.active { border-color: var(--brand-blue); }
.panel.details-panel { padding: 2.5rem; }
.panel.details-panel h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin: 0 0 1rem 0; color: var(--primary-dark); word-wrap: break-word; }
.details-description { color: var(--secondary-text); line-height: 1.8; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-color); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
.detail-item { display: flex; align-items: flex-start; }
.detail-item i { font-size: 1.1rem; color: var(--brand-blue); width: 20px; margin-right: 15px; margin-top: 4px; }
.detail-item strong { display: block; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--secondary-text); margin-bottom: 4px; }
.detail-item span { font-size: 1rem; color: var(--primary-text); }
.section-divider { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--border-color); }
.section-title { font-size: 1.3rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--primary-dark); }
.attachment-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.attachment-thumbnail a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); transition: all 0.2s ease; }
.attachment-thumbnail a:hover { transform: scale(1.05); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.attachment-thumbnail img { width: 100%; height: 90px; object-fit: cover; display: block; }
.no-attachments { font-style: italic; color: #888; font-size: 0.9rem; text-align: center; padding: 2rem; border-radius: 8px; border: 1px dashed #ddd; background: #fdfdfd; }
.upload-instruction { font-size: 0.85rem; color: #6c757d; margin-top: -1rem; margin-bottom: 1.5rem; }
.upload-proof-form form { display: flex; flex-direction: column; gap: 1rem; }
.upload-proof-form input[type="file"] { display: none; }
.upload-buttons { display: flex; gap: 1rem; }
.custom-file-upload { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.2rem; border: 1px solid #ccc; border-radius: 8px; cursor: pointer; background: #f8f9fa; font-weight: 500; transition: all 0.2s ease; }
.custom-file-upload:hover { background: #e9ecef; }
.btn-upload { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.5rem; background: #2ecc71; color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-upload:hover { background: #28a745; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
#file-preview-container { width: 100%; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.file-preview-item { display: flex; align-items: center; padding: 0.75rem; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; animation: fadeIn 0.3s ease; }
.file-preview-item i { font-size: 1.5rem; color: #6c757d; margin-right: 1rem; }
.file-info { flex-grow: 1; overflow: hidden; }
.file-info .file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info .file-size { font-size: 0.8rem; color: #888; }
.remove-file-btn { background: none; border: none; color: #e74c3c; font-size: 1.2rem; cursor: pointer; padding: 0.5rem; margin-left: 1rem; line-height: 1; }
.remove-file-btn:hover { color: #c0392b; }
#file-preview-placeholder { text-align: center; font-style: italic; color: #888; padding: 1.5rem; border: 2px dashed #ddd; border-radius: 8px; }
.ai-recommendations { margin-top: 2.5rem; }
.horizontal-scroll-container { display: flex; gap: 1.5rem; overflow-x: auto; padding: 0.5rem 0 1.5rem 0; }
.rec-card { flex: 0 0 220px; display: flex; flex-direction: column; background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border-color); text-decoration: none; color: var(--primary-text); overflow: hidden; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.03), 0 10px 20px rgba(0,0,0,0.03); }
.rec-card:hover { transform: translateY(-6px); box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 15px 30px rgba(0,0,0,0.05); }
.rec-card-img-container { width: 100%; height: 160px; overflow: hidden; }
.rec-card-img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.rec-card:hover .rec-card-img-container img { transform: scale(1.05); }
.rec-card-info { padding: 1rem; font-size: 0.9rem; }
.rec-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-card-score { font-size: 0.85rem; font-weight: 700; color: var(--brand-blue); margin-bottom: 0.75rem; }
.rec-card-reasons { font-size: 0.8rem; color: #6c757d; line-height: 1.5; }
.rec-card-reasons strong { color: #555; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.single-page-header, .single-page-mobile-wrapper { display: none; }


/* 
======================================================
    --- 4. RESPONSIVE STYLES (< 992px) ---  (FIXED)
======================================================
*/
@media (max-width: 991px) {

    /* ✅ FIX: Remove the desktop padding and set direction to column */
    .page-layout { 
        flex-direction: column; 
        padding-left: 0; 
        padding-bottom: var(--bottom-nav-height); /* Add padding to prevent content from hiding behind bottom nav */
    }
    
    .main-content { 
        padding: 15px; 
    }

    /* ✅ FIX: Reset the sidebar from a "floating card" to a traditional slide-in panel */
    .sidebar {
        /* Keep it fixed for the slide-in effect */
        position: fixed; 
        /* Reset floating properties */
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0;
        box-shadow: none; /* Shadow will be added by the 'sidebar-open' class */
        /* Slide it off-screen by default */
        transform: translateX(-100%);
        z-index: 1100;
    }
    
    body.sidebar-open .sidebar { 
        transform: translateX(0); 
        box-shadow: 0 0 40px rgba(0,0,0,0.5); 
    }
    
    .mobile-backdrop { 
        display: none; 
    }
    
    body.sidebar-open .mobile-backdrop { 
        display: block; 
        position: fixed; 
        inset: 0; 
        background: rgba(0,0,0,0.5); 
        z-index: 1050; 
    }

    /* ✅ FIX: Hide the complex desktop header */
    .page-header {
        display: none;
    }

    /* --- Universal Mobile Header Styles --- */
    /* These styles are for the simple mobile header we added to item-page.php.
       You should now add this HTML structure to ALL your pages for a consistent mobile UI. */
    .mobile-header {
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        background: var(--card-bg);
        box-shadow: 0 2px 10px rgba(0,0,0,0.06);
        border-radius: 16px;
        position: sticky;
        top: 15px; /* Creates a nice floating effect for the header on mobile */
        z-index: 1010;
        margin-bottom: 1.5rem;
    }
    .mobile-menu-button {
        background: none;
        border: none;
        color: var(--primary-dark);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0;
        margin-right: 1rem;
    }
    .mobile-page-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--primary-dark);
        margin: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    /* --- Bottom Nav Styles (Unchanged but depend on the fixes above) --- */
    .bottom-nav { 
        display: block; 
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        height: var(--bottom-nav-height); 
        background: var(--sidebar-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -3px 20px rgba(0,0,0,0.1); 
        z-index: 1020;
    }
    .bottom-nav ul { 
        display: flex; 
        list-style: none; 
        width: 100%; 
        height: 100%; 
        align-items: center;
        justify-content: space-around;
    }
    .bottom-nav ul li { 
        flex: 1; 
        display: flex; 
        justify-content: center; 
        align-items: center; 
        height: 100%;
        position: relative;
    }
    .bottom-nav ul a { 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        gap: 4px; 
        color: var(--sidebar-text); 
        width: 100%; 
        height: 100%; 
        font-size: 0.7rem; 
        transition: color 0.2s ease;
    }
    .bottom-nav ul a i { 
        font-size: 1.3rem; 
        margin-bottom: 2px; /* Added for better spacing */
    }
    .bottom-nav ul a.active { 
        color: var(--brand-yellow); 
    }
    .bottom-nav .bottom-nav-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        background: var(--brand-yellow);
        color: var(--primary-dark);
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        font-size: 1.5rem;
        transform: translateY(-45%);
        top: 0;
        position: absolute;
    }
    .bottom-nav .bottom-nav-fab span { 
        display: none; 
    }

    /* Adjust single-page grid for tablet/mobile */
    .single-wrapper {
        grid-template-columns: 1fr;
    }
}



/*
======================================================
  --- 4. NEW RESPONSIVE STYLES (< 992px) ---
======================================================
*/

/* Hide mobile-only elements on desktop by default */
.mobile-header, .bottom-nav, .mobile-backdrop, .mobile-back-button {
    display: none;
}

@media (max-width: 991px) {

    /* Re-organize the main page layout for mobile */
    .page-layout { 
        flex-direction: column; 
        padding-left: 0; 
        padding-bottom: calc(var(--bottom-nav-height) + 15px); /* Space for bottom nav */
    }
    
   /* In layout_style.css, inside @media (max-width: 991px) */
.page-layout {
    /* This will release the child elements from being trapped */
    overflow: visible;
}
.main-content { 
    padding: 15px; 
    
    /* 
       THIS IS THE CRUCIAL FIX. 
       It removes the "clipping box" around the main content, 
       allowing the sticky header to stick to the viewport and the transform to work.
    */
    overflow: visible; 
}

    /* Convert the sidebar into an off-canvas menu */
    .sidebar {
        position: fixed; 
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
        transform: translateX(-100%);
        z-index: 1100;
    }
    
    body.sidebar-open .sidebar { 
        transform: translateX(0); 
        box-shadow: 0 0 40px rgba(0,0,0,0.5); 
    }
    
    /* Make the backdrop visible when the menu is open */
    .mobile-backdrop { 
        display: block; 
        position: fixed; 
        inset: 0; 
        background: rgba(0,0,0,0); 
        z-index: 1050; 
        pointer-events: none;
        transition: background-color 0.3s;
    }
    body.sidebar-open .mobile-backdrop { 
        background: rgba(0,0,0,0.5); 
        pointer-events: all;
    }

    /* Hide the complex desktop header */
    .page-header {
        display: none;
    }

    /* Show the mobile header (its styles are in mobile_header.php) */
    .mobile-header {
        display: flex;
    }
    
    /* Show and style the new bottom navigation bar */
   /* In layout_style.css, inside the @media (max-width: 991px) block */

/* 
   ======================================================
      --- 1. MODIFIED Bottom Nav for "Notched" UI ---
   ======================================================
*/

/* First, we make the original container transparent and remove its shadow/border,
   because the new ::before pseudo-element will handle the appearance. */
.bottom-nav { 
    display: block; 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: var(--bottom-nav-height); 
    z-index: 1020;
    
    /* --- CHANGES ARE HERE --- */
    background: transparent;  /* REMOVED var(--sidebar-bg) */
    border-top: none;         /* REMOVED the border */
    box-shadow: none;         /* REMOVED the shadow */
    transition: transform 0.3s ease-in-out; /* Keep the scroll animation */
}

/* Second, we add this NEW pseudo-element. This creates the visible
   bar shape and uses a 'clip-path' to cut out the notch. */

/* ✅ THIS IS THE NEW AND IMPROVED CODE FOR THE NOTCH */
.bottom-nav::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sidebar-bg); /* The bar's color */
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -3px 20px rgba(0,0,0,0.05);

    /* This CSS mask creates the notch with excellent browser support */
    -webkit-mask: radial-gradient(circle at 50% 0, transparent 35px, black 36px);
            mask: radial-gradient(circle at 50% 0, transparent 35px, black 36px);
}
    .bottom-nav ul { 
        display: flex; 
        list-style: none; 
        width: 100%; 
        height: 100%; 
        align-items: stretch;
    }
    .bottom-nav ul li { 
        flex: 1; 
        display: flex; 
        justify-content: center; 
        align-items: center; 
        position: relative;
    }
    .bottom-nav ul a { 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        gap: 4px; 
        color: var(--sidebar-text); 
        width: 100%; 
        height: 100%; 
        font-size: 0.7rem; 
        font-weight: 500;
        transition: color 0.2s ease;
    }
    .bottom-nav ul a i { 
        font-size: 1.3rem; 
    }
    .bottom-nav ul a.active { 
        color: var(--brand-yellow); 
    }
    .bottom-nav .fab-container { 
        flex: 0 0 60px; /* Create space for the FAB */
    }
    .bottom-nav .bottom-nav-fab { 
        position: absolute;
        top: -28px; /* Lifts the button up */
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        background: var(--brand-yellow);
        color: var(--primary-dark);
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        font-size: 1.5rem;
    }
    .bottom-nav .bottom-nav-fab span { 
        display: none; 
    }
    
    /* Adjust item grid for a single column on mobile */
    .item-grid { 
        grid-template-columns: 1fr; 
        gap: 1rem; 
    }
    .item-card { 
        border-radius: 16px; 
    }

    /* Adjust single-page view for mobile */
    .single-wrapper {
        grid-template-columns: 1fr;
    }
}


/* 1. Add a smooth transition to the header and bottom nav */
.mobile-header,
.bottom-nav {
    transition: transform 0.3s ease-in-out;
}

/* 2. Define the 'hidden' state for when the user scrolls down */
body.ui-hidden .mobile-header {
    transform: translateY(-120%); /* Slides the header up and out of view */
}

body.ui-hidden .bottom-nav {
    transform: translateY(100%); /* Slides the bottom nav down and out of view */
}


/*
======================================================
  --- UI Refinement: Card Details & Status Tag ---
======================================================
*/

/* 1. Improves spacing between the icon and text in the card's metadata */
/* 1. ✅ NEW, MORE SPECIFIC RULE for card metadata spacing */
.item-card .card-meta span {
    display: inline-flex; /* Use flexbox for easy alignment */
    align-items: center;  /* Vertically align icon and text */
    gap: 0.4rem;          /* Adds a clean, consistent space between them */
}

/* 2. Makes the "LOST" tag more vibrant for better visual signaling */
.item-status.lost {
    background-color: #F85A5A; /* A more saturated, modern red */
    color: #ffffff;
}

/* 3. (Optional but recommended) Let's do the same for the "FOUND" tag for consistency */
.item-status.found {
    background-color: #34D399; /* A nice, modern green */
    color: #ffffff;
}

/*
======================================================
  --- UI Refinement: Interactive Press States ---
======================================================
*/

/* This adds a smooth transition effect to the item card's link */
.item-card > a {
    display: block; /* Ensures the anchor tag fills the card for the effect */
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* This is the "press" effect. It triggers when the user taps/clicks */
.item-card > a:active {
    transform: scale(0.97); /* Subtly shrinks the card */
    /* The transition property above makes this happen smoothly */
}


/*
======================================================
  --- Component Styling: Claim Button ---
======================================================
*/

.item-card .btn-claim {
    /* --- Reset default button styles --- */
    border: none;
    font-family: inherit; /* Use the same Poppins font */
    cursor: pointer;
    
    /* --- Sizing and Spacing --- */
    display: block; /* Make it a block-level element */
    width: 100%;    /* Make it fill the width of the card padding */
    padding: 0.8rem 1rem;
    margin-top: 0.5rem; /* Add some space from the content above */

    /* --- Appearance and Color --- */
    background-color: var(--brand-yellow); /* Use your primary action color! */
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 600; /* Make the text bold and confident */
    text-align: center;
    border-radius: 12px; /* Match the card's border-radius for consistency */

    /* --- Smooth Transition for interactions --- */
    transition: background-color 0.2s ease, transform 0.15s ease;
}

/* --- Add Hover and Press States for Feedback --- */

/* On desktop, change color slightly on hover */
.item-card .btn-claim:hover {
    background-color: #f7b801; /* A slightly darker yellow */
}

/* On tap/click, give that satisfying "press" effect */
.item-card .btn-claim:active {
    transform: scale(0.98);
}


/*
======================================================
  --- Final Card Polish: Robustness & Consistency ---
======================================================
*/

/* 1. Ensures all card images are the same size for a clean grid */
.card-image-wrapper {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f0f0f0;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents image distortion */
}

/* 2. Prevents long titles from breaking the card layout */
.card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* The number of lines to show (for older browsers) */
    line-clamp: 2;         /* The number of lines to show (the new standard) */
    -webkit-box-orient: vertical;
}


.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    
    /* This part creates the icon fallback */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef; /* A light gray background */
    font-family: "Font Awesome 6 Free"; /* Tells the browser to use Font Awesome font */
    font-weight: 900; /* Use the solid style for the icon */
    color: #adb5bd;   /* A muted gray color for the icon */
    font-size: 1.5rem; /* The size of the icon */
}

/* This pseudo-element IS the icon */
.avatar::before {
    content: '\f007'; /* The Font Awesome unicode for the 'user' icon */
}

/* This special selector hides the icon ONLY if the <img> tag successfully loads an image */
.avatar[src]:not([src=""]) {
    font-size: 0; /* Hides the icon by making its font size 0 */
}
.avatar[src]:not([src=""])::before {
    content: ''; /* Removes the icon content entirely */
}
