/* ============================
   LISTING FEED MAIN CONTAINER
============================= */
#listing-feed-box {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    border-radius: 10px;
    font-size: 16px;
    position: relative;
}
@media (max-width: 600px) {
    #listing-feed-box {
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
}
/* ============================
   POSTING FORM - CAMPIDU STYLE
============================= */
.feed-post-card {
    background: #f5f7fb; /* Light Blue Tint */
    border: 1px solid #d5e3f3;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.feed-post-card h5 {
    margin: 0 0 14px 0;
    font-size: 17px;
    font-weight: 600;
    color: #002255;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Category + conditional fields row */
.feed-post-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.feed-post-fields select,
.feed-post-fields input[type="date"],
.feed-post-fields input[type="text"] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd4e1;
    background: #f8fafc;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s ease, background .2s ease;
}

.feed-post-fields select:focus,
.feed-post-fields input:focus {
    border-color: #002255;
    background: #fff;
    outline: none;
}

/* Textarea styling */
.feed-post-card textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #cbd4e1;
    border-radius: 10px;
    resize: vertical;
    font-size: 15px;
    background:#fff;
    transition: border-color .2s ease, background .2s ease;
    font-family: inherit;
}
.feed-post-card textarea:focus {
    border-color:#002255;
    background:#fff;
}

/* Upload + Post button row */
.feed-post-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Upload button styling */
.custom-upload {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #F4F8FC; /* softer, lighter blue */
    border: 1px solid #D3E3F3;
    color: #002255;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .22s ease;
    user-select: none;
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.custom-upload:hover {
    background: #E9F2FB;
    border-color: #C1D6EB;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.custom-upload input[type="file"] {
    display: none;
}

/* Filename styling */
.upload-filename {
    font-size: 13px;
    color: #445;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .85;
}

/* Post button */
.feed-post-card button {
    background:#002255;
    color:#fff;
    border:none;
    border-radius:8px;
    padding: 12px 22px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition: background-color .2s ease, transform .15s ease;
    white-space:nowrap;
}
.feed-post-card button:hover { opacity: 0.85; }
.feed-post-card button:active { transform: scale(0.97); }

/* SUCCESS MESSAGE */
#listing-feed-success {
    font-size: 13px;
    color: #1a7f37;
    margin-top: 8px;
    display: none;
}

/* MOBILE: button becomes full width */
@media (max-width: 480px) {
    .feed-post-card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .feed-post-card button {
        width: 100%;
    }
}

/* ============================
   FEED POST ITEMS
============================= */
.feed-post {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    clear: both;
    overflow: hidden;
    position: relative;
    font-size: 16px;
}
.feed-post-extra {
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    margin-bottom: 4px;
}
.feed-post p {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    color: #222;
}

.feed-post-image {
    margin-left: 10px;
    object-fit: contain;
	max-width: 360px  !important;
	max-height: 360px !important;
	width: auto !important;
	height: auto !important;
    border-radius: 8px;
    background: #eee;
    border-left:#ccc;
    padding-left:5px;
	display: block;
	-webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}
@media (max-width: 760px) {
    .feed-post-image {
        max-width: 260px  !important;
        max-height: 260px  !important;
        margin: 0 auto;
    }
}
/* ============================
   ACTION BUTTONS
============================= */
.feed-heart-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #e0245e;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: transform .15s ease;
}
.feed-heart-btn:hover:not(:disabled) { transform: scale(1.2); }
.feed-delete-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    color: #d9534f;
    font-size: 16px;
    cursor: pointer;
    margin-left: 6px;
    padding: 2px 6px;
}

.feed-delete-btn:hover {opacity: .85;}

/* ============================
   COMMENTS
============================= */
.feed-comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #0073aa;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-left: 10px;
}
.feed-comment-btn:hover { color:#005177; }

/* ============================
   PAGINATION
============================= */
#listing-feed-pagination {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 6px;
    flex-wrap: wrap;
}
#listing-feed-pagination button {
    background: none;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #002255;
}
#listing-feed-pagination button.active,
#listing-feed-pagination button:hover {
    background-color: #002255;
    color: white;
    border-color: #002255;
}

/* ============================
   FILTER BAR
============================= */
.feed-filter-bar {
    font-size:13px;
    margin-bottom:12px;
    display:flex;
    gap:10px;
	position: sticky;
    top: 0;
    z-index: 50;
	background: #ffffff;
	padding: 6px 0;
}
.feed-filter-bar a {
    color:#666;
    text-decoration:none;
    padding:4px 8px;
    border-radius:0 0 6px 6px;
}
.feed-filter-bar a.active {
    background:#f1f3f5;
    color:#002255;
    font-weight:700;
}

/* ============================
   AJAX Blur Loader Overlay
============================= */
#feed-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    z-index: 20;
}
#feed-loading .spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #ccc;
    border-top-color: #002255;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================
   Skeleton Shimmer Loader
============================= */
.feed-skeleton {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.feed-skeleton-card {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 12px;
    position: relative;
    overflow: hidden;
}
.feed-skeleton-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.feed-skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
}
.feed-skeleton-line {
    height: 10px;
    border-radius: 5px;
    background: #e0e0e0;
    margin-bottom: 6px;
}
.feed-skeleton-line.short { width: 40%; }
.feed-skeleton-line.medium { width: 70%; }
.feed-skeleton-line.long { width: 90%; }
.feed-skeleton-thumb {
    width: 130px;
    height: 90px;
    border-radius: 8px;
    background: #e0e0e0;
    margin-top: 8px;
}
.feed-skeleton-shimmer {
    position: absolute;
    top: 0;
    left: -150px;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: feedShimmer 1.2s infinite;
}
@keyframes feedShimmer {
    0%   { transform: translateX(0); }
    100% { transform: translateX(300px); }
}

/* ============================
   Infinite Scroll Loader
============================= */
.feed-infinite-loader {
    text-align: center;
    padding: 10px 0;
}
.feed-loading-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #ccc;
    border-top-color: #002255;
    animation: spin 0.8s linear infinite;
}

/* ============================
   Custom Scrollbar
============================= */
#listing-feed-box::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
#listing-feed-box::-webkit-scrollbar-thumb {
    background: rgba(79, 123, 145, 0.6);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
    opacity: 0;
}
#listing-feed-box:hover::-webkit-scrollbar-thumb,
#listing-feed-box:active::-webkit-scrollbar-thumb {
    opacity: 1;
}
#listing-feed-box::-webkit-scrollbar-thumb:hover {
    background: rgba(47, 83, 98, 0.8);
}
#listing-feed-box {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 123, 145, 0.6) transparent;
}
#listing-feed-box:hover {
    scrollbar-color: rgba(47, 83, 98, 0.8) transparent;
}
/* ============================
   Missing Styles from Version #1
============================ */

/* Error Message */
#listing-feed-error {
    color: #d9534f;
    font-size: 13px;
    margin-bottom: 10px;
    display: none;
}

/* Divider between form and posts */
.feed-divider {
    border: 0;
    height: 1px;
    margin: 24px 0;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* Feed Post Info (date line) */
.feed-post-info {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    clear: both;
}

/* Post Actions Wrapper (Like + Comment row) */
.feed-post-actions {
    margin-top: 8px;
}

/* Heart Count Text */
.feed-heart-count {
    font-size: 16px;
    color: #555;
    user-select: none;
    min-width: 20px;
    text-align: left;
}

/* Disabled Heart Button */
.feed-heart-btn:disabled {
    cursor: default;
    opacity: 0.6;
    transform: none;
}

/* Comment Wrapper */
.feed-comment-area {
    margin-top: 8px;
    margin-left: 4px;
}

/* Comment textarea */
.feed-comment-textarea {
    width: 100%;
    resize: vertical;
    min-height: 60px;
    max-height: 100px;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
}

/* Submit comment button */
.feed-comment-submit {
    margin-top: 6px;
    background-color: #002255;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.feed-comment-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Comments List */
.feed-comments-list {
    margin-top: 10px;
    padding-left: 16px;
    font-size: 14px;
    color: #444;
    border-left: 2px solid #ddd;
}

/* Single Comment */
.feed-comment {
    margin-bottom: 10px;
    position: relative;
}
.feed-comment-area small a {color:#222}

/* Comment Author */
.feed-comment-author {
    font-weight: 600;
    color: #0073aa;
}

/* Comment Date */
.feed-comment-date {
    font-size: 11px;
    color: #999;
    margin-left: 6px;
}

/* Comment text */
.feed-comment-text {
    margin-top: 3px;
    white-space: pre-wrap;
}

/* Comment Delete Button */
.feed-comment-delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 4px;
    user-select: none;
}
.feed-comment-delete-btn:hover {
    color: #b52b27;
}

/* Category Badge next to post title */
.feed-category-badge {
    display:inline-block;
    background:#ff00aa;
    color:#fff;
    padding:2px 8px;
    border-radius:12px;
    font-weight:700;
    font-size:12px;
    margin-right:8px;
}

/* Pagination disabled state */
#listing-feed-pagination button:disabled {
    cursor: default;
    opacity: 0.5;
}
.feed-post-highlight {
    animation: dlfFlash 2s ease-in-out;
    border-radius: 6px;
}
@keyframes dlfFlash {
    0%   { background: #fff7b1; }
    50%  { background: #ffeb3b; }
    100% { background: transparent; }
}
.feed-post-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.feed-share-btn{
  background:none;
  border:1px solid #c8d4ff;
  color:#002255;
  border-radius:50%;
  padding:6px 10px;
  font-size:16px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:10px;
}

.feed-share-btn:hover {
    background: #fff;
}
.feed-post-card-collapsible .feed-post-card-toggle{cursor:pointer;user-select:none;justify-content:space-between;width:100%}
.feed-toggle-icon{transition:transform .25s ease}
.feed-post-card-collapsible.is-collapsed .feed-toggle-icon{transform:rotate(-90deg)}
.feed-post-card-body{overflow:hidden;max-height:1200px;transition:max-height .35s ease}
.feed-post-card-collapsible.is-collapsed .feed-post-card-body{max-height:0}
.feed-post-card-collapsible.is-pill{padding:12px 16px;border-radius:999px}
.feed-post-card-collapsible.is-pill .feed-post-card-toggle{margin:0;font-size:15px}
.feed-post-card-toggle{transition:color .2s ease}
.feed-post-card-toggle:hover{color:#003399}
.feed-comments-list,.feed-comment-area{display:none;opacity:0;transform:translateY(-6px);will-change:opacity,transform}.feed-comments-list.is-open,.feed-comment-area.is-open{opacity:1;transform:translateY(0)}
/* Keep pagination subtle on desktop */
#listing-feed-pagination{
  margin-top:10px;
  opacity:.6;
  transition:opacity .15s ease;
}
#listing-feed-pagination:hover{opacity:1}

/* Hide on mobile */
@media (max-width:600px){
  #listing-feed-pagination{display:none!important;}
}