/* Core Design System - Facebook UI/UX Redesign for VVS1 DongHo */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ===== CHẶN ZOOM TRÊN MOBILE (CSS LAYER) ===== */
html {
    /* Ngăn touch zoom bằng CSS */
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
    background-color: var(--bg-base) !important;
    font-family: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
    /* Ngăn chọn text không mong muốn khi double-tap */
    -webkit-tap-highlight-color: transparent;
    font-family: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base) !important;
    background: var(--bg-base-gradient) !important;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

input, button, select, textarea {
    font-family: inherit;
}

.font-monospace, span.font-monospace, small.font-monospace, div.font-monospace {
    font-family: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

:root {
    --bs-font-monospace: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    --bs-body-font-family: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    --bs-font-sans-serif: 'Outfit', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;

    /* Purple/Violet Dark Mode Colors (Default) */
    --bg-base: #18191a;
    --bg-surface: #242526;
    --bg-base-gradient: linear-gradient(to bottom, #18191a, #18191a);
    --text-primary: #e4e6eb;
    --text-muted: #b0b3b8;
    --text-secondary: var(--text-muted);
    --border-color: #3e4042;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Purple Brand Colors */
    --fb-blue: #8b5cf6;
    --fb-blue-hover: #7c3aed;
    --fb-blue-light: rgba(139, 92, 246, 0.15);
    --fb-gray-bg: #3a3b3c;
    --fb-gray-bg-hover: #4e4f50;

    /* Keep compatibility with old colors mapped to Purple palette */
    --purple-primary: #8b5cf6;
    --purple-hover: #7c3aed;

    --input-bg: #3a3b3c;
    --input-focus-bg: #4e4f50;
    --input-border: #3e4042;
    --input-text: #e4e6eb;

    --header-bg: #242526;
    --modal-bg: #242526;

    /* Nickname Colors */
    --color-admin-cc: #f56565;
    /* Red */
    --color-admin2: #ed8936;
    /* Orange */
    --color-vip: #c084fc;
    /* Light Purple */
    --color-member: #60a5fa;
    /* Blue */
}

html.light-mode {
    /* Purple/Violet Light Mode Colors */
    --bg-base: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-base-gradient: linear-gradient(to bottom, #f0f2f5, #f0f2f5);
    --text-primary: #050505;
    --text-muted: #65676b;
    --text-secondary: var(--text-muted);
    --border-color: #e4e6eb;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    --fb-blue: #7c3aed;
    --fb-blue-hover: #6d28d9;
    --fb-blue-light: rgba(124, 58, 237, 0.1);
    --fb-gray-bg: #f0f2f5;
    --fb-gray-bg-hover: #e4e6eb;

    --purple-primary: #7c3aed;
    --purple-hover: #6d28d9;

    --input-bg: #f0f2f5;
    --input-focus-bg: #e4e6eb;
    --input-border: #ccd0d5;
    --input-text: #050505;

    --header-bg: #ffffff;
    --modal-bg: #ffffff;

    /* Nickname Colors */
    --color-admin-cc: #e53e3e;
    --color-admin2: #dd6b20;
    --color-vip: #7c3aed;
    --color-member: #1a8cd8;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base) !important;
    background: var(--bg-base-gradient) !important;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Facebook Layout 3 Columns */
.fb-main-container {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

.fb-left-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    overflow-y: auto;
    padding-right: 8px;
}

.fb-middle-feed {
    flex-grow: 1;
    max-width: 680px;
    margin: 0 auto;
}

.fb-right-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    overflow-y: auto;
}

@media (max-width: 1200px) {
    .fb-right-sidebar {
        display: none;
    }
}

@media (max-width: 992px) {
    .fb-left-sidebar {
        display: none;
    }

    .fb-middle-feed {
        max-width: 100%;
    }
}

/* Facebook Cards (Overriding Glass cards for Compatibility) */
.glass-card,
.fb-card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: var(--card-shadow) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;

}

.glass-card:hover,
.fb-card:hover {
    transform: none !important;
    box-shadow: var(--card-hover-shadow) !important;
}

/* Nicknames for roles */
.user-admin_cc {
    color: var(--color-admin-cc) !important;
    font-weight: 700;
}

.user-admin2 {
    color: var(--color-admin2) !important;
    font-weight: 700;
}

.user-vip {
    color: var(--color-vip) !important;
    font-weight: 700;
}

.user-member {
    color: var(--color-member) !important;
    font-weight: 600;
}

/* Custom Facebook Buttons */
.btn-fb-primary {
    background-color: var(--fb-blue) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: background-color 0.2s ease;
}

.btn-fb-primary:hover {
    background-color: var(--fb-blue-hover) !important;
}

.btn-fb-secondary {
    background-color: var(--fb-gray-bg) !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: background-color 0.2s ease;
    margin-right: 5px;
}

.btn-fb-secondary:hover {
    background-color: var(--fb-gray-bg-hover) !important;
}

/* Form Styles */
.form-control,
.form-select {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
}

#inputSearchGreen:focus {
    border-color: #22c55e !important;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-focus-bg) !important;
    border-color: var(--fb-blue) !important;
    box-shadow: 0 0 0 2px var(--fb-blue-light) !important;
    color: var(--text-primary) !important;
}

/* Header & Navbar - Facebook Style */
.custom-navbar {
    background-color: var(--header-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
    padding: 6px 16px !important;
    position: sticky !important;
    top: 0;
    z-index: 1030;
}

.fb-nav-search {
    background-color: var(--fb-gray-bg);
    border-radius: 50px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 240px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-nav-search:focus-within {
    width: 300px;
}

@media (max-width: 575.98px) {

    /* Style search form as a rounded circle by default on mobile */
    .fb-nav-search {
        width: 36px !important;
        height: 36px !important;
        max-width: 36px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        justify-content: center !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        gap: 0 !important;
    }

    .fb-nav-search input {
        width: 0 !important;
        opacity: 0 !important;
        padding: 0 !important;
        border: none !important;
        position: absolute !important;
    }

    .fb-nav-search i.fa-magnifying-glass {
        margin: 0 !important;
        font-size: 1.05rem !important;
    }

    /* When active (focused or has value), expand to take full space and hide other buttons */
    .search-active .fb-nav-search {
        width: auto !important;
        max-width: none !important;
        flex-grow: 1 !important;
        border-radius: 50px !important;
        padding: 6px 12px !important;
        justify-content: flex-start !important;
        gap: 8px !important;
    }

    .search-active .fb-nav-search input {
        width: 100% !important;
        opacity: 1 !important;
        position: static !important;
        padding-right: 28px !important;
        display: block !important;
        font-size: 0.95rem !important;
    }

    /* Hide logo and other dropdowns on mobile during active search */
    .search-active .hdr-user-btn,
    .search-active .hdr-cat-btn,
    .search-active .navbar-brand {
        display: none !important;
    }

    /* Reduce navbar padding and branding logo height on mobile */
    .custom-navbar {
        padding: 6px 8px !important;
    }

    .navbar-brand img {
        height: 32px !important;
    }
}



.fb-nav-search input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-primary) !important;
    width: 100%;
    font-size: 0.9rem;
}

.fb-nav-search input::placeholder {
    color: var(--text-muted);
}

/* Nav center tabs styling */
.fb-nav-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-grow: 1;
    max-width: 600px;
}

.fb-nav-tab {
    flex: 1;
    max-width: 110px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none !important;
    border-radius: 8px;
}

.fb-nav-tab:hover {
    background-color: var(--fb-gray-bg-hover);
    color: var(--text-primary);
}

.fb-nav-tab.active {
    color: var(--fb-blue);
    border-bottom: 3px solid var(--fb-blue);
    border-radius: 0;
}

/* Sidebar Menu Items */
.fb-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none !important;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.fb-sidebar-item:hover {
    background-color: var(--fb-gray-bg-hover);
}

.fb-sidebar-item i {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--fb-gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.fb-sidebar-item.active {
    background-color: var(--fb-blue-light);
    color: var(--fb-blue);
}

.fb-sidebar-item.active i {
    background-color: var(--fb-blue);
    color: #ffffff;
}

/* Facebook Post Layout Components */
.fb-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fb-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.fb-post-meta {
    line-height: 1.2;
}

.fb-post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Post Actions Footer Buttons */
.fb-post-actions {
    display: flex;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
    margin-top: 12px;
}

.fb-post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.fb-post-action-btn:hover {
    background-color: var(--fb-gray-bg);
    color: var(--text-primary);
}

.fb-post-action-btn.active {
    color: var(--fb-blue);
}

/* Facebook Messenger Layout */
.messenger-container {
    display: flex;
    height: calc(100vh - 76px);
    background-color: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.messenger-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.messenger-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
}

.messenger-list {
    flex-grow: 1;
    overflow-y: auto;
}

.messenger-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.messenger-user-item:hover {
    background-color: var(--fb-gray-bg);
}

.messenger-user-item.active {
    background-color: var(--fb-blue-light);
}

.messenger-user-avatar {
    position: relative;
}

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

.messenger-online-badge {
    width: 12px;
    height: 12px;
    background-color: #31a24c;
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

.messenger-chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.messenger-messages-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-bubble {
    max-width: 60%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    background-color: var(--fb-blue);
    color: #ffffff;
}

.message-bubble.received {
    align-self: flex-start;
    background-color: var(--fb-gray-bg);
    color: var(--text-primary);
}

.messenger-input-area {
    padding: 12px 16px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

/* Facebook Profile Cover & Profile Design */
.fb-profile-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
}

/* .fb-profile-cover {
    width: 100%;
    height: 340px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 0 0 8px 8px;
    position: relative;
    overflow: hidden;
} */

.fb-profile-avatar-container {
    max-width: 1250px;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    padding: 0 32px;
    display: flex;
    align-items: flex-end;
    position: relative;
    margin-top: -100px;
    padding-bottom: 24px;
}

/* Desktop: dời 2 nút mail/share sang trái để gần viền vàng QC hơn */
@media (min-width: 992px) {
    .profile-actions-btns {
        margin-left: 16px !important;
    }
}

.fb-profile-avatar-img {
    width: 200px;
    height: 200px;

    border: 4px solid var(--bg-surface);
    object-fit: cover;
    z-index: 2;
    background-color: var(--bg-surface);
}

.fb-profile-info {
    margin-left: 24px;
    padding-bottom: 16px;
    flex-grow: 1;
}

.fb-profile-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.2;
}

/* Override text contrast adjustments globally */
.text-white:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not(.badge-gold):not(.badge-auction):not(.badge-sale):not(.badge-ad):not(.badge-news):not([class*="bg-"]) {
    color: var(--text-primary) !important;
}

.text-light:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-muted) !important;
}

.text-secondary:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-secondary) !important;
}

.text-muted:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-muted) !important;
}

html.light-mode .text-white:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not(.badge-gold):not(.badge-auction):not(.badge-sale):not(.badge-ad):not(.badge-news):not([class*="bg-"]) {
    color: var(--text-primary) !important;
}

html.light-mode .text-light:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-muted) !important;
}

html.light-mode .text-secondary:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-secondary) !important;
}

html.light-mode .text-muted:not(.badge):not(.btn):not(.alert):not(.btn-close):not(.bg-danger):not(.bg-success):not(.bg-info):not(.bg-warning):not(.bg-primary):not(.bg-secondary):not(.bg-dark):not([class*="bg-"]) {
    color: var(--text-muted) !important;
}

/* Fix static white outlines and colors on buttons in navigation wrapper */
html.light-mode .btn-outline-light {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

html.light-mode .btn-outline-light:hover {
    background: var(--fb-blue) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* Table and Modal */
.modal-content {
    background: var(--modal-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.table {
    color: var(--text-primary) !important;
}

.table th,
.table td {
    border-color: var(--border-color) !important;
}

/* ===== FACEBOOK STYLE IMAGE COLLAGE ===== */
.fb-image-collage {
    display: grid;
    gap: 2px;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.fb-image-collage .collage-img-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: none;
    /* No individual cell borders for a seamless Facebook-like collage look */
}

.fb-image-collage .collage-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.fb-image-collage .collage-img-wrapper:hover img {
    transform: scale(1.015);
    filter: brightness(1.03);
}

/* Single image custom sizing: stretches to full width, scales naturally up to max-height, like Facebook feed cards */
.fb-image-collage.collage-1 {
    display: block;
    background: none;
}

.fb-image-collage.collage-1 .collage-img-wrapper {
    width: 100%;
    height: auto;
    max-height: 520px;
    border: none;
    display: block;
}

.fb-image-collage.collage-1 .collage-img-wrapper img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    /* Cover mode matches Facebook feed style card behavior */
}

/* Two images layout */
.fb-image-collage.collage-2 {
    grid-template-columns: 1fr 1fr;
    height: 280px;
}

/* Three images layout (1 large left, 2 stacked right) */
.fb-image-collage.collage-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 280px;
}

.fb-image-collage.collage-3 .img-wrapper-0 {
    grid-row: span 2;
    height: 100%;
}

/* Four images layout (2x2 symmetrical grid, clean & equal details) */
.fb-image-collage.collage-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1 / 1;
    height: auto !important;
}

/* Five images layout (2 top equal columns, 3 bottom equal columns) */
.fb-image-collage.collage-5 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1.2fr 1fr;
    height: 280px;
}

.fb-image-collage.collage-5 .img-wrapper-0,
.fb-image-collage.collage-5 .img-wrapper-1 {
    grid-column: span 3;
    height: 100%;
}

.fb-image-collage.collage-5 .img-wrapper-2,
.fb-image-collage.collage-5 .img-wrapper-3,
.fb-image-collage.collage-5 .img-wrapper-4 {
    grid-column: span 2;
    height: 100%;
}

/* Tablet & Medium Screen Devices (768px and up) */
@media (min-width: 768px) {

    .fb-image-collage.collage-1 .collage-img-wrapper,
    .fb-image-collage.collage-1 .collage-img-wrapper img {
        max-height: 600px;
    }

    .fb-image-collage.collage-2,
    .fb-image-collage.collage-3,
    .fb-image-collage.collage-4,
    .fb-image-collage.collage-5 {
        height: 380px;
    }
}

/* Desktop computers (992px and up) */
@media (min-width: 992px) {

    .fb-image-collage.collage-1 .collage-img-wrapper,
    .fb-image-collage.collage-1 .collage-img-wrapper img {
        max-height: 650px;
    }

    .fb-image-collage.collage-2,
    .fb-image-collage.collage-3,
    .fb-image-collage.collage-4,
    .fb-image-collage.collage-5 {
        height: 480px;
    }
}

.fb-image-collage .more-images-overlay::after {
    content: attr(data-more);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

/* Force all multi-image post collages to be square */
.fb-image-collage:not(.collage-1) {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    max-height: none !important;
}

.fb-image-collage.collage-1 {
    aspect-ratio: auto !important;
    height: auto !important;
    max-height: none !important;
}

.fb-image-collage.collage-1 .collage-img-wrapper {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    background: transparent !important;
}

.fb-image-collage.collage-1 .collage-img-wrapper img,
.fb-image-collage.collage-1 .collage-img-wrapper video {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
}

.fb-image-collage.collage-2,
.fb-image-collage.collage-3,
.fb-image-collage.collage-4,
.fb-image-collage.collage-5 {
    height: auto !important;
}

/* Force featured live auction card images to be square */
.col-md-4 .fb-card .text-center.position-relative.mb-2.rounded.overflow-hidden {
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
}

/* ===== LIGHTBOX PHOTO THEATER (FACEBOOK STYLE) ===== */
.fb-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.95);
    user-select: none;
}

.fb-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.fb-lightbox-content.has-zoomed {
    display: flex !important;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
}

.fb-lightbox-img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    cursor: zoom-in;
    display: inline-block;
    vertical-align: middle;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.fb-lightbox-img.zoomed {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    cursor: grab;
    cursor: -webkit-grab;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.fb-lightbox-img.zoomed:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.fb-lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s, transform 0.2s;
    z-index: 2010;
}

.fb-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.fb-lightbox-btn:active {
    transform: scale(0.95);
}

.fb-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.fb-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.fb-lightbox-close {
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.fb-lightbox-counter {
    position: absolute;
    top: 25px;
    left: 25px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 600;
    z-index: 2010;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== FACEBOOK STYLE COMMENTS SECTION ===== */
.fb-comments-section {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.fb-comment-input-area {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.fb-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.fb-comment-input-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.fb-comment-input {
    width: 100%;
    background: var(--fb-gray-bg) !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 8px 45px 8px 16px !important;
    color: var(--text-primary) !important;
    font-size: 0.92rem;
    outline: none;
    transition: background 0.2s;
}

.fb-comment-input:focus {
    background: var(--fb-gray-bg-hover) !important;
}

.fb-comment-send-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--fb-blue);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
    padding: 0;
}

.fb-comment-send-btn:hover {
    transform: scale(1.1);
}

.fb-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fb-comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.fb-comment-bubble-wrapper {
    position: relative;
    display: inline-block;
    max-width: 85%;
}

.fb-comment-bubble {
    background: var(--fb-gray-bg);
    border-radius: 18px;
    padding: 8px 16px;
    width: 100%;
}

.fb-comment-like-badge {
    position: absolute;
    bottom: -6px;
    right: 8px;
    background-color: var(--fb-gray-bg-hover);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    z-index: 2;
}

.fb-comment-replies {
    margin-left: 44px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reply-item .reply-avatar {
    width: 26px;
    height: 26px;
}

@media (max-width: 576px) {
    .fb-comment-replies {
        margin-left: 24px;
    }
}

.fb-reply-context-banner {
    border-left: 3px solid var(--fb-blue);
    background: var(--fb-gray-bg) !important;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.fb-comment-username {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-decoration: none !important;
}

.fb-comment-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.fb-comment-actions {
    margin-top: 4px;
    padding-left: 12px;
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.fb-comment-action-link {
    color: var(--text-muted);
    text-decoration: none !important;
    font-weight: 600;
    cursor: pointer;
}

.fb-comment-action-link.comment-like-btn.active {
    color: var(--fb-blue) !important;
}

.fb-comment-action-link:hover {
    color: var(--text-primary);
}

.fb-post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fb-post-reacts {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fb-react-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    color: #fff;
}

.fb-react-like {
    background: var(--fb-blue);
}

.fb-react-love {
    background: #f02849;
}

/* ===== LIGHTBOX PHOTO THEATER (FACEBOOK STYLE BOTTOM CONTROLS & SWIPE) ===== */
.fb-lightbox-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px;
}

.fb-lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow: hidden !important;
}

.fb-lightbox-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
    width: 100%;
    z-index: 2010;
    margin-top: 10px;
}

.fb-lightbox-ctrl-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    transition: all 0.2s ease !important;
    position: static !important;
    /* overrides absolute */
}

.fb-lightbox-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

.fb-lightbox-counter-bottom {
    color: #ffffff !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ===== FACEBOOK STYLE NOTIFICATION DROPDOWN ===== */
.notif-dropdown-menu {
    width: 380px !important;
    max-height: 520px !important;
    overflow-y: auto !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

.notif-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    margin: 8px 12px;
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.notif-item.unread {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.notif-avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.notif-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.notif-type-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    border: 1.5px solid var(--bg-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.notif-type-badge.like {
    background: var(--fb-blue);
}

.notif-type-badge.comment {
    background: #22c55e;
}

.notif-type-badge.comment_reply {
    background: #a855f7;
    /* Purple */
}

.notif-type-badge.comment_like {
    background: var(--fb-blue);
    /* Blue like standard likes */
}

.notif-type-badge.auction_win {
    background: #ffd700;
    color: #000;
}

.notif-type-badge.auction_sold {
    background: #10b981;
}

.notif-type-badge.auction_no_bid {
    background: #ef4444;
}

.notif-type-badge.forgot_password {
    background: #ef4444;
}

.notif-type-badge.new_register {
    background: #a855f7;
}

.notif-type-badge.info {
    background: #3b82f6;
}

/* ===== NEW FB LOCK SCREEN STYLE NOTIFICATION LAYOUT ===== */
.notif-left-icon-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-left-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notif-left-icon.like {
    background: #3b82f6;
}

.notif-left-icon.comment {
    background: #22c55e;
}

.notif-left-icon.comment_reply {
    background: #a855f7;
}

.notif-left-icon.comment_like {
    background: #3b82f6;
}

.notif-left-icon.auction_win {
    background: #ffd700;
    color: #000;
}

.notif-left-icon.auction_sold {
    background: #10b981;
}

.notif-left-icon.auction_no_bid {
    background: #ef4444;
}

.notif-left-icon.forgot_password {
    background: #ef4444;
}

.notif-left-icon.new_register {
    background: #a855f7;
}

.notif-left-icon.device_approval {
    background: #ef4444;
}

.notif-left-icon.info {
    background: #3b82f6;
}

.notif-right-avatar-container {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-right-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.notif-item.unread .notif-title {
    font-weight: 700;
}

.notif-item.read .notif-title {
    font-weight: 500;
}

.notif-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--fb-blue);
    margin-top: 4px;
}

.notif-item.read .notif-time {
    color: var(--text-muted);
}

.notif-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.notif-unread-dot {
    width: 10px;
    height: 10px;
    background: #a855f7;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.notif-unread-dot:hover {
    transform: scale(1.25);
}

.notif-btn-action {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    /* hidden by default, visible on hover */
}

.notif-item:hover .notif-btn-action,
.notif-btn-action:focus {
    opacity: 1;
}

.notif-btn-action:hover {
    background: var(--fb-gray-bg-hover);
    color: var(--text-primary);
}

.notif-btn-action.delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notif-btn-action.read-btn:hover {
    color: var(--fb-blue);
    background: var(--fb-blue-light);
}

/* Ensure icons are always visible on mobile */
@media (max-width: 768px) {
    .notif-dropdown-menu {
        width: 320px !important;
    }

    .notif-btn-action {
        opacity: 0.8;
    }
}

/* ===== BOOTSTRAP OVERRIDES FOR COHESIVE PURPLE THEME ===== */
.btn-primary {
    background-color: var(--fb-blue) !important;
    border-color: var(--fb-blue) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--fb-blue-hover) !important;
    border-color: var(--fb-blue-hover) !important;
    color: #ffffff !important;
}

.text-primary {
    color: var(--fb-blue) !important;
}

.btn-outline-primary {
    color: var(--fb-blue) !important;
    border-color: var(--fb-blue) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background-color: var(--fb-blue) !important;
    border-color: var(--fb-blue) !important;
    color: #ffffff !important;
}

.border-primary {
    border-color: var(--fb-blue) !important;
}

.bg-primary {
    background-color: var(--fb-blue) !important;
}

.badge.bg-primary {
    background-color: var(--fb-blue) !important;
    color: #ffffff !important;
}

/* ===== MOBILE DROPDOWN OVERFLOW & HEADER RESPONSIVENESS ===== */
@media (max-width: 576px) {
    .custom-navbar .dropdown-menu {
        position: fixed !important;
        top: 56px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        z-index: 1050 !important;
    }

    .custom-navbar .container-fluid {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .navbar-brand {
        margin-right: 4px !important;
    }
}

/* ===== USER ROLE NICKNAME COLORING & STAR STYLING ===== */
.user-admin_cc {
    color: var(--color-admin-cc) !important;
}

.user-admin2 {
    color: var(--color-admin2) !important;
}

.user-vip {
    color: var(--color-vip) !important;
}

.user-member {
    color: var(--color-member) !important;
    /* Xanh - Thành viên thường (không có sao) */
}

/* ===== HIDDEN COMMENT STYLING ===== */
.comment-hidden-style {
    opacity: 0.6 !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
    border-left: 3px solid #ef4444 !important;
    padding-left: 8px;
    border-radius: 4px;
}

/* ===== HIGHLIGHT PERKS (ƯU ĐIỂM) STYLING ===== */
.highlight-perks {
    color: #a3e635 !important;
    font-weight: 700;
}

html.light-mode .highlight-perks {
    color: #4d7c0f !important;
}

/* ===== SEARCH HISTORY DROPDOWN ===== */
.search-history-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 280px !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    z-index: 2000 !important;
    box-shadow: var(--card-shadow) !important;
}

.history-item-wrapper:hover {
    background: var(--fb-gray-bg-hover) !important;
}

.remove-history-btn:hover {
    background: var(--fb-gray-bg) !important;
    color: #ef4444 !important;
}

.history-empty-state {
    padding: 20px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
}

/* ===== SQUARE AVATARS WITH ROUNDED CORNERS (FACEBOOK PAGE STYLE) ===== */
img.rounded-circle,
.nav-avatar,
.fb-post-author-img,
.fb-comment-avatar,
.notif-avatar,
.messenger-user-avatar img,
.fb-profile-avatar-img,
.post-avatar,
.seller-avatar,
.post-avatar-container {
    border-radius: 50% !important;
}

/* ===== POST TEXT TRUNCATION (FACEBOOK STYLE 2 LINES CLAMP) ===== */
.post-text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* ===== SHRUNKEN AVATARS FOR FEED, COMMENTS, AND CHAT FOR HIGH TRAFFIC SPEED ===== */
.post-avatar {
    width: 32px !important;
    height: 32px !important;
}

.post-avatar-container {
    width: 36px !important;
    height: 36px !important;
}

.fb-comment-avatar {
    width: 28px !important;
    height: 28px !important;
}

.reply-item .reply-avatar {
    width: 24px !important;
    height: 24px !important;
}

.u-av {
    width: 36px !important;
    height: 36px !important;
}

.ct-av {
    width: 32px !important;
    height: 32px !important;
}

.seller-avatar {
    width: 44px !important;
    height: 44px !important;
}

/* ===== GOLD PINNED BADGE STYLING ===== */
.badge-gold {
    background: rgba(253, 224, 71, 0.15) !important;
    color: #eab308 !important;
    /* Gold */
    border: 1px solid #eab308 !important;
    font-weight: 700 !important;
}

.badge-pin-vip {
    background: rgba(34, 211, 238, 0.15) !important;
    color: #22d3ee !important;
    border: 1px solid #22d3ee !important;
    font-weight: 700 !important;
}

/* Post Chat Button size adjustment */
.post-chat-btn {
    font-size: 0.9rem !important;
    padding: 6px 12px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 20px !important;
}

/* ===== CRISP WEB LOGO SHARPNESS & KB REDUCTION ===== */
.custom-navbar .navbar-brand img {
    height: 32px !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ===== POST HEADER GRID LAYOUT FOR PERFECT VERTICAL ALIGNMENT ===== */
.post-header-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    row-gap: 4px !important;
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    z-index: 100 !important;
}

.post-header-left {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .post-header-left {
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        gap: 3px !important;
    }

    .post-header-left .post-nickname {
        font-size: 0.82rem !important;
    }

    .post-header-left .user-badges {
        font-size: 0.72rem !important;
        gap: 2px !important;
    }

    .post-header-left .admin-memo-text {
        font-size: 0.75rem !important;
    }

    .post-header-left .badge {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }

    .post-header-wrap small {
        font-size: 0.72rem !important;
    }
}

/* ===== WHITE BACKGROUND FOR FEED DROPDOWNS ===== */
.dropdown-menu-dark-custom {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 2000 !important;
    right: 0 !important;
    left: auto !important;
}

.dropdown-menu-dark-custom .dropdown-item {
    color: #212529 !important;
    font-size: 0.9rem !important;
    padding: 8px 20px !important;
}

.dropdown-menu-dark-custom .dropdown-item:hover {
    background: #f8f9fa !important;
    color: #1e2125 !important;
}

.dropdown-menu-dark-custom .dropdown-divider {
    border-top: 1px solid #e9ecef !important;
}

/* Elevate active post card to float its dropdown menus on top of other post cards */
.post-card:has(.dropdown-menu.show),
.glass-card:has(.dropdown-menu.show),
.fb-card:has(.dropdown-menu.show) {
    z-index: 1020 !important;
    position: relative;
    overflow: visible !important;
}

/* Styling for device approval notification badge */
.notif-type-badge.device_approval {
    background: #f97316 !important;
}

/* Commented post purple style */
.post-card.commented-post {
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    background: rgba(139, 92, 246, 0.08) !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1) !important;
}

html.light-mode .post-card.commented-post {
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    background: rgba(124, 58, 237, 0.05) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.06) !important;
}

/* Premium Pagination Styling */
.pagination .page-item .page-link {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background-color: var(--fb-blue) !important;
    border-color: var(--fb-blue) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4) !important;
}

.pagination .page-item .page-link:hover:not(.active) {
    background-color: var(--fb-gray-bg-hover) !important;
    color: var(--text-primary) !important;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== FACEBOOK-STYLE BIDDING HIGHLIGHT BOX ===== */

html.light-mode .bidding-highlight-box {
    background: rgba(24, 119, 242, 0.02) !important;
}

/* ===== Post card color-coded borders ===== */
/* Tin Ghim các loại => màu Tím */
.glass-card.pinned-post,
.post-detail-card.pinned-post,
.pinned-post {
    border: 2px solid rgba(139, 92, 246, 0.6) !important;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15) !important;
    background: var(--bg-surface) !important;
}

/* Tin đấu giá => màu đỏ */
.glass-card.auction-post-border,
.post-detail-card.auction-post-border,
.auction-post-border {
    border: 2px solid rgba(239, 68, 68, 0.65) !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15) !important;
}

/* Đấu giá + Ghim => màu vàng */
.glass-card.auction-pinned-post,
.post-detail-card.auction-pinned-post,
.auction-pinned-post {
    border: 2px solid rgba(234, 179, 8, 0.75) !important;
    box-shadow: 0 4px 24px rgba(234, 179, 8, 0.25) !important;
}

/* ===== PIN POPUP SYSTEM (Purple, White Text) ===== */
.pin-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border: 1.5px solid #d97706;
    border-radius: 6px;
    background: transparent;
    color: #d97706;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.pin-trigger-btn:hover,
.pin-trigger-btn.active {
    background: #d97706;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
}

.pin-popup-wrap {
    position: relative;
    display: inline-block;
}

.pin-popup-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;
    background: var(--bg-surface, #242526);
    border: 1.5px solid #8b5cf6;
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: pinPopupIn 0.15s ease;
}

@keyframes pinPopupIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pin-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.15);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.pin-popup-close {
    background: none;
    border: none;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.pin-popup-close:hover {
    color: #ef4444;
}

.pin-popup-options {
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 4px;
}

.pin-opt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary, #fff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.pin-opt-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color, #333);
}

.pin-opt-normal {
    color: #c59b27 !important;
}

.pin-opt-normal:hover {
    background: rgba(196, 155, 39, 0.1) !important;
    border-color: rgba(196, 155, 39, 0.4) !important;
}

.pin-opt-vip {
    color: #eab308 !important;
}

.pin-opt-vip:hover {
    background: rgba(234, 179, 8, 0.12) !important;
    border-color: rgba(234, 179, 8, 0.4) !important;
}

.pin-cost {
    margin-left: auto;
    font-size: 0.78rem;
    opacity: 0.85;
}

/* ===== NEW POST TYPE BADGES ===== */
.badge-knowledge {
    background: rgba(6, 182, 212, 0.15) !important;
    color: #06b6d4 !important;
    border: 1px solid #06b6d4 !important;
    font-weight: 700 !important;
}

.badge-entertainment {
    background: rgba(244, 114, 182, 0.15) !important;
    color: #f472b6 !important;
    border: 1px solid #f472b6 !important;
    font-weight: 700 !important;
}

/* ===== @MENTION AUTOCOMPLETE DROPDOWN ===== */
.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-surface, #242526);
    border: 1px solid var(--border-color, #3e4042);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary, #e4e6eb);
    transition: background 0.2s;
    text-align: left;
}

.mention-item:hover,
.mention-item.active {
    background: var(--fb-gray-bg-hover, #3a3b3c);
    color: var(--text-primary, #e4e6eb);
}

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

.mention-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mention-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.mention-username {
    font-size: 0.75rem;
    color: var(--text-muted, #b0b3b8);
}

/* Footer Billboard Theme Adaptability */
.footer-billboard-card {
    background: var(--bg-surface) !important;
    border-top: 1.5px solid var(--border-color) !important;
    border-bottom: 1.5px solid var(--border-color) !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: var(--card-shadow) !important;
    color: var(--text-primary) !important;
    transition: all 0.3s ease;
}

#footerBillboardContent {
    color: var(--text-primary) !important;
}

#footerBillboardContent h3 {
    color: var(--fb-blue) !important;
}

#footerBillboardContent .text-muted {
    color: var(--text-muted) !important;
}

html.light-mode .bg-purple-nap {
    background-color: var(--fb-blue-light) !important;
    color: var(--fb-blue) !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
}

.bg-purple-nap {
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    display: inline-flex !important;
    align-items: center !important;
}

.bg-purple-nap:hover {
    opacity: 0.9 !important;
    transform: scale(1.04) !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4) !important;
}

.bg-purple-nap:active {
    transform: scale(0.96) !important;
}

/* Cây bút chỉnh sửa nút tím */
.bg-purple-nap .edit-badge-pen {
    display: none !important;
}

.note-editable .bg-purple-nap .edit-badge-pen {
    display: inline-block !important;
    margin-left: 6px !important;
    opacity: 0.65 !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: opacity 0.2s !important;
}

.note-editable .bg-purple-nap .edit-badge-pen:hover {
    opacity: 1 !important;
    color: #ffffff !important;
}

#btnEditFooterBillboard {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgb(234, 179, 8) !important;
    color: rgb(234, 179, 8) !important;
    /* light purple */
    transition: all 0.2s ease;
}

#btnEditFooterBillboard:hover {
    background: var(--fb-blue) !important;
    color: #ffffff !important;
    border-color: var(--fb-blue) !important;
}

html.light-mode #btnEditFooterBillboard {
    background: var(--bg-surface) !important;
    border: 1px solid var(--fb-blue) !important;
    color: var(--fb-blue) !important;
}

html.light-mode #btnEditFooterBillboard:hover {
    background: var(--fb-blue) !important;
    color: #ffffff !important;
}

/* ── Google Translate Banner & Tooltip Hiding ── */
iframe.goog-te-banner-frame,
iframe.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
.goog-te-banner,
#goog-gt-tt,
.goog-te-balloon-frame,
.skiptranslate {
    display: none !important;
    visibility: hidden !important;
}

body {
    top: 0 !important;
    position: static !important;
}

html {
    padding-top: 0 !important;
    top: 0 !important;
}

.goog-text-highlight {
    background: transparent !important;
    box-shadow: none !important;
}

/* Online status dot (inside avatar, bottom-right corner) */
.user-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #1a1a2e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
    z-index: 5;
    pointer-events: none;
}

.user-online-dot::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.4);
    animation: user-online-pulse 1.8s ease-out infinite;
}

@keyframes user-online-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.avatar-online-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

/* ===== MOBILE MODAL POSITIONING ===== */
/* Ensure modals appear in upper area of screen and don't stick to bottom */
@media (max-width: 576px) {
    .modal-dialog:not(.modal-dialog-centered):not(.modal-dialog-scrollable) {
        margin-top: 60px !important;
        margin-bottom: 20px !important;
        max-width: calc(100% - 24px) !important;
    }

    /* For explicitly positioned modals (likesModal, followModal, profileLikesModal) */
    #likesModal .modal-dialog,
    #followModal .modal-dialog,
    #profileLikesModal .modal-dialog {
        margin-top: 50px !important;
        margin-bottom: 30px !important;
        max-width: calc(100% - 20px) !important;
    }
}

/* Nickname responsiveness without truncation */
.post-nickname {
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Responsive padding for post cards to match post_detail.php */
.post-card {
    padding: 16px !important;
}

@media (max-width: 575.98px) {
    .post-card {
        padding: 10px !important;
    }
}

/* ===== FIX SUMMERNOTE LITE COLOR PICKER & DROPDOWNS FOR BOOTSTRAP 5 ===== */
.note-editor .note-dropdown-menu {
    min-width: 360px !important;
    width: 360px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

.note-editor .note-dropdown-menu.show {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
}

.note-editor .note-dropdown-menu .note-holder {
    display: inline-block !important;
    width: 160px !important;
    vertical-align: top !important;
    margin: 0 !important;
}

.note-editor .note-dropdown-menu .note-holder .note-color-palette {
    min-width: unset !important;
    width: 100% !important;
}

/* Hide browser default password reveal and clear buttons (Chrome, Edge, Safari) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Số xu hiển thị màu xanh ngọc #22d3ee toàn hệ thống */
.xu-count-badge {
    color: #22d3ee !important;
}

/* Light mode modal color adjustments */
html.light-mode .modal-content {
    background-color: var(--modal-bg) !important;
    background: var(--modal-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

html.light-mode .modal-content .modal-title {
    color: var(--text-primary) !important;
}

html.light-mode .modal-content .btn-close-white {
    filter: none !important;
}

html.light-mode .modal-content hr,
html.light-mode .modal-content .border-secondary {
    border-color: var(--border-color) !important;
}

html.light-mode .modal-content .text-secondary {
    color: var(--text-muted) !important;
}

html.light-mode .modal-content .text-muted {
    color: var(--text-muted) !important;
}