:root {
    --primary-color: #f27123;
    --primary-hover: #d95e14;
    --primary-light: #fff3ec;
    --secondary-color: #2c3e50;
    --success-color: #198754;
    --danger-color: #dc3545;

    /* Theme variables - Light Mode (Mặc định) */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.12);
    --shadow-color: rgba(15, 23, 42, 0.16);
    --header-bg: #ffffff;
    --compact-header-bg: rgba(255, 255, 255, 0.92);
    --nav-bg-full: #ffffff;
    --nav-bg-compact: rgba(255, 255, 255, 0.92);
    --nav-border-compact: rgba(242, 113, 35, 0.35);
    --nav-shadow-compact: 0 14px 35px rgba(15, 23, 42, 0.16), 0 0 20px rgba(249, 115, 22, 0.08);
    --nav-text-color: #1e293b;
    --nav-text-hover: #f27123;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --compact-logo-text: #172033;
}

[data-theme="dark"] {
    /* Theme variables - Dark Mode */
    --bg-body: #0b1120;
    --bg-surface: #131d31;
    --bg-surface-elevated: #1a2744;
    --bg-subtle: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.13);
    --shadow-color: rgba(0, 0, 0, 0.48);
    --header-bg: #0d1420;
    --compact-header-bg: rgba(13, 20, 32, 0.92);
    --nav-bg-full: #0d1420;
    --nav-bg-compact: rgba(13, 20, 32, 0.92);
    --nav-border-compact: rgba(242, 113, 35, 0.45);
    --nav-shadow-compact: 0 14px 35px rgba(0, 0, 0, 0.48), 0 0 20px rgba(242, 113, 35, 0.2);
    --nav-text-color: #f1f5f9;
    --nav-text-hover: #fb923c;
    --card-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --compact-logo-text: #ffffff;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styling cho các thành phần chính */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .post-card,
[data-theme="dark"] .search-card {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .post-card-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-dark {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-surface-elevated) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-surface-elevated) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-main) !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-subtle) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .list-group-item {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .comment-bubble {
    background-color: var(--bg-subtle) !important;
    color: var(--text-main) !important;
}

/* Chuyển màu nhẹ nhàng khi đổi Theme cho toàn bộ website */
body,
.navbar-custom,
.post-card,
.search-card,
.modal-content,
.dropdown-menu,
.form-control,
.form-select,
button,
input,
select,
textarea {
    transition:
        background-color 250ms ease,
        color 250ms ease,
        border-color 250ms ease,
        box-shadow 250ms ease;
}

/* Main content layout */
main {
    flex: 1 0 auto;
    /* Dành khoảng trống cố định cho header fixed để nội dung không bị che và không bị nhảy */
    padding-top: 96px;
}

/* ==========================================================================
   FPT FROG MASCOT & SCROLL PROGRESS DIVIDER
   Phong cách hiện đại, tối màu, mượt mà và cân đối tuyệt đối
   ========================================================================== */

/* Toàn bộ khu vực dải trang trí linh vật */
.fpt-mascot-section {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #090d16 0%, #0f172a 50%, #090d16 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 6px 0 8px 0;
    overflow: hidden;
    user-select: none;
    z-index: 10;
}

/* Thanh rãnh nền tiến trình cuộn trang */
.fpt-scroll-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    z-index: 12;
}

/* Thanh màu tiến trình cuộn trang mượt mà (dùng scaleX để đạt 60fps) */
.fpt-scroll-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #f97316 60%, #ea580c 100%);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.75), 0 0 5px rgba(16, 185, 129, 0.5);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Cụm thanh ngang chứa con cóc FPT chính xác ở giữa */
.fpt-mascot-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 8px;
    gap: clamp(10px, 2.5vw, 24px);
    box-sizing: border-box;
}

/* Thanh ngang bên trái và bên phải (chiều dài tự động cân đối bằng nhau) */
.fpt-divider-line {
    flex: 1;
    height: 2.5px;
    border-radius: 99px;
    position: relative;
    overflow: hidden;
    min-width: 20px;
}

/* Thanh bên trái: Gradient từ xanh lá sang cam FPT (hướng vào con cóc) */
.fpt-divider-line-left {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.8) 40%, #f97316 100%);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.35), 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Thanh bên phải: Gradient từ cam FPT sang xanh lá (tỏa ra từ con cóc) */
.fpt-divider-line-right {
    background: linear-gradient(90deg, #f97316 0%, rgba(16, 185, 129, 0.8) 60%, rgba(16, 185, 129, 0.15) 100%);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.35), 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Lớp phát sáng tiến trình cuộn trên từng thanh ngang */
.fpt-divider-line .fpt-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f97316);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.7), 0 0 6px rgba(16, 185, 129, 0.6);
    transform: scaleX(0);
    will-change: transform;
}

.fpt-divider-line-left .fpt-line-progress {
    transform-origin: right center;
}

.fpt-divider-line-right .fpt-line-progress {
    transform-origin: left center;
}

/* Khung bọc linh vật con cóc FPT */
.fpt-mascot {
    width: clamp(64px, 8vw, 110px);
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    z-index: 2;
}

/* Khung chuyển động của con cóc (nhún, chớp mắt, nghiêng khi cuộn) */
.fpt-mascot-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fptFrogBounce 3.4s ease-in-out infinite, fptFrogIdleTilt 7s ease-in-out infinite;
    transform-origin: 50% 90%;
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

/* Hình ảnh SVG của con cóc */
.fpt-frog-svg,
.fpt-frog-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    display: block;
}

/* Hiệu ứng chớp mắt hoạt hình cho mí mắt con cóc */
.frog-eyelid {
    animation: fptFrogBlink 4.5s infinite;
    transform-origin: 50% 50%;
}

/* Keyframe nhún lên xuống nhẹ khi đứng yên */
@keyframes fptFrogBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4.5px);
    }
}

/* Keyframe nghiêng người nhẹ định kỳ */
@keyframes fptFrogIdleTilt {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-1.5deg);
    }
    40% {
        transform: rotate(0deg);
    }
    70% {
        transform: rotate(1.5deg);
    }
    85% {
        transform: rotate(0deg);
    }
}

/* Keyframe chớp mắt tự nhiên */
@keyframes fptFrogBlink {
    0%, 91%, 100% {
        opacity: 0;
        transform: scaleY(0);
    }
    94%, 97% {
        opacity: 0.95;
        transform: scaleY(1);
    }
}

/* Hỗ trợ khả năng tiếp cận: Tắt animation nếu người dùng chọn prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .fpt-mascot-inner {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .frog-eyelid {
        animation: none !important;
        opacity: 0 !important;
    }
    .fpt-scroll-progress-bar,
    .fpt-line-progress {
        transition: none !important;
    }
}

/* Responsive tối ưu trên màn hình nhỏ */
@media (max-width: 576px) {
    .fpt-mascot-section {
        padding: 4px 0 6px 0;
    }
    .fpt-mascot-divider {
        gap: clamp(8px, 2vw, 14px);
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f27123 0%, #e65100 100%);
    color: white;
    padding: 22px 0 24px 0;
    border-radius: 0 0 18px 18px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.hero-subtitle {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.9;
}

@media (max-width: 576px) {
    .hero-section {
        padding: 16px 0 18px 0;
        border-radius: 0 0 14px 14px;
        margin-bottom: 16px;
    }
    .hero-title {
        font-size: 0.95rem;
        line-height: 1.3;
        letter-spacing: -0.1px;
    }
    .hero-subtitle {
        font-size: 0.75rem;
        line-height: 1.35;
    }
}

.search-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    padding: 20px;
    margin-top: 20px;
}

/* Post Cards */
.post-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.post-thumb-wrapper {
    position: relative;
    height: 200px;
    background-color: #f1f5f9;
    overflow: hidden;
}

.post-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumb {
    transform: scale(1.05);
}

.badge-post-type {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.post-card-body {
    padding: 16px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1e293b;
    text-decoration: none;
}

.post-card-title:hover {
    color: var(--primary-color);
}

.post-meta-item {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-outline-primary-custom {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-outline-primary-custom:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Image preview thumbnails */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* OTP Input */
.otp-input {
    letter-spacing: 12px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    color: var(--primary-color);
}

/* Comments */
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-bubble {
    background: #f1f5f9;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 6px;
}

.reply-indent {
    margin-left: 48px;
    border-left: 2px solid #e2e8f0;
    padding-left: 16px;
}

/* Floating Action Buttons: Nút Đăng tin nổi (Bên Phải) & Nút Tin nhắn nổi (Bên Trái) */

/* Nút Đăng tin nổi (Cố định góc dưới cùng bên PHẢI) */
.fab-post-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1040;
    background: linear-gradient(135deg, #f27123 0%, #ff8c42 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 1.02rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(242, 113, 35, 0.45);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-post-btn:hover {
    background: linear-gradient(135deg, #d95e14 0%, #f27123 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(242, 113, 35, 0.6);
    color: #ffffff !important;
}

.fab-post-btn i {
    font-size: 1.25rem;
}

/* Nút Tin nhắn nổi (Cố định góc dưới cùng bên TRÁI, dạng tròn gọn gàng) */
.fab-chat-btn {
    position: fixed !important;
    bottom: 24px !important;
    left: 24px !important;
    z-index: 1040 !important;
    width: 48px !important;
    height: 48px !important;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4) !important;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.fab-chat-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.55);
    color: #ffffff !important;
}

.fab-chat-btn i {
    font-size: 1.25rem !important;
}

.fab-unread-badge {
    font-size: 0.68rem;
    padding: 3px 6px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

@media (max-width: 576px) {
    .fab-post-btn {
        bottom: 16px;
        right: 16px;
        padding: 9px 15px;
        font-size: 0.88rem;
    }
    .fab-chat-btn {
        bottom: 16px;
        left: 16px;
        width: 42px !important;
        height: 42px !important;
    }
    .fab-post-btn i {
        font-size: 1.1rem;
    }
    .fab-chat-btn i {
        font-size: 1.1rem !important;
    }
}

/* ==========================================================================
   HỆ THỐNG BẢNG HIỆU & KHUNG DANH HIỆU LUXURY VIP (USER REPUTATION SYSTEM)
   ========================================================================== */

.badge-reputation {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    line-height: 1;
    border-radius: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    user-select: none;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: none;
    margin: 3px 0;
}

.badge-reputation-xs {
    font-size: 0.68rem;
    padding: 2.5px 7px;
    margin-left: 5px;
    border-radius: 5px;
}

.badge-reputation-sm {
    font-size: 0.72rem;
    padding: 3.5px 9px;
    margin-left: 6px;
}

.badge-reputation-md {
    font-size: 0.85rem;
    padding: 6px 14px;
    margin-left: 8px;
}

.badge-reputation-lg {
    font-size: 1.05rem;
    padding: 9px 20px;
    letter-spacing: 0.5px;
}

/* Hiệu ứng vệt sáng kim loại quét qua (Metallic Light Sweep) */
.badge-sheen {
    position: absolute;
    top: -60%;
    left: -130%;
    width: 60%;
    height: 220%;
    background: linear-gradient(
        75deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0) 80%
    );
    transform: rotate(25deg);
    animation: luxurySheenSweep 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

@keyframes luxurySheenSweep {
    0%, 30% { left: -130%; }
    60%, 100% { left: 150%; }
}

/* ================== TIER 1: NGƯỜI TỬ TẾ (KHUNG MÀU ĐỒNG LẤP LÁNH - Bronze Sparkling Frame) ================== */
.badge-tier-1 {
    background: linear-gradient(125deg, #fff7ed 0%, #ffedd5 18%, #fed7aa 35%, #ffffff 50%, #fb923c 65%, #c2410c 85%, #7c2d12 100%);
    background-size: 260% 260%;
    animation: bronzeShimmer 4s ease infinite;
    color: #431407;
    border: 1.8px solid #b45309;
    outline: 1.5px solid #fb923c;
    outline-offset: 1px;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.45), inset 0 1.5px 1.5px #ffffff, inset 0 -1px 2px rgba(124, 45, 18, 0.3);
    font-weight: 750;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.badge-tier-1:hover {
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.75), inset 0 2px 2px #ffffff;
    transform: scale(1.02);
}
.badge-tier-1 .badge-icon,
.badge-tier-1 i.bi-heart-fill {
    color: #ef4444 !important; /* Trái tim đỏ nổi bật, không bị bôi xám hay chìm màu */
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.65)) !important;
}
@keyframes bronzeShimmer {
    0% { background-position: 0% 50%; box-shadow: 0 0 8px rgba(249, 115, 22, 0.4), inset 0 1.5px 1px #fff; }
    50% { background-position: 100% 50%; box-shadow: 0 0 16px rgba(251, 146, 60, 0.75), 0 0 8px rgba(180, 83, 9, 0.6), inset 0 2px 2px #fff; }
    100% { background-position: 0% 50%; box-shadow: 0 0 8px rgba(249, 115, 22, 0.4), inset 0 1.5px 1px #fff; }
}

/* ================== TIER 2: NGHĨA HIỆP (KHUNG MÀU BẠC LẤP LÁNH - Sterling Silver Sparkling Frame) ================== */
.badge-tier-2 {
    background: linear-gradient(125deg, #ffffff 0%, #f1f5f9 20%, #cbd5e1 38%, #ffffff 52%, #94a3b8 70%, #64748b 88%, #334155 100%);
    background-size: 260% 260%;
    animation: silverShimmer 4s ease infinite;
    color: #0f172a;
    border: 1.8px solid #64748b;
    outline: 1.5px solid #cbd5e1;
    outline-offset: 1px;
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.5), inset 0 1.5px 1.5px #ffffff, inset 0 -1px 2px rgba(51, 65, 85, 0.3);
    font-weight: 750;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}
.badge-tier-2:hover {
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.8), inset 0 2px 2px #ffffff;
    transform: scale(1.02);
}
.badge-tier-2 .badge-icon {
    color: #475569;
    filter: drop-shadow(0 0 4px rgba(203, 213, 225, 0.9));
}
@keyframes silverShimmer {
    0% { background-position: 0% 50%; box-shadow: 0 0 9px rgba(148, 163, 184, 0.45), inset 0 1.5px 1px #fff; }
    50% { background-position: 100% 50%; box-shadow: 0 0 18px rgba(226, 232, 240, 0.85), 0 0 10px rgba(100, 116, 139, 0.6), inset 0 2px 2px #fff; }
    100% { background-position: 0% 50%; box-shadow: 0 0 9px rgba(148, 163, 184, 0.45), inset 0 1.5px 1px #fff; }
}

/* ================== TIER 3: HIỆP SĨ (KHUNG MÀU VÀNG LẤP LÁNH - 24K Royal Gold Sparkling Frame) ================== */
.badge-tier-3 {
    background: linear-gradient(125deg, #fffbeb 0%, #fef08a 18%, #f59e0b 38%, #ffffff 52%, #fde047 68%, #d97706 84%, #78350f 100%);
    background-size: 260% 260%;
    animation: goldShimmer 3.6s ease infinite;
    color: #451a03;
    border: 2px solid #b45309;
    outline: 1.8px solid #fbbf24;
    outline-offset: 1.2px;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.6), inset 0 1.5px 2px #ffffff, inset 0 -1px 2px rgba(69, 26, 3, 0.35);
    font-weight: 800;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.85);
}
.badge-tier-3:hover {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.9), 0 0 14px rgba(254, 240, 138, 0.8), inset 0 2px 2px #ffffff;
    transform: scale(1.02);
}
.badge-tier-3 .badge-icon {
    color: #b45309;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.85));
}
@keyframes goldShimmer {
    0% { background-position: 0% 50%; box-shadow: 0 0 12px rgba(217, 119, 6, 0.5), inset 0 1.5px 2px #fff; }
    50% { background-position: 100% 50%; box-shadow: 0 0 22px rgba(245, 158, 11, 0.85), 0 0 12px rgba(254, 240, 138, 0.9), inset 0 2px 3px #fff; }
    100% { background-position: 0% 50%; box-shadow: 0 0 12px rgba(217, 119, 6, 0.5), inset 0 1.5px 2px #fff; }
}

/* ================== TIER 4: NGƯỜI HÙNG (KHUNG KIM CƯƠNG LẤP LÁNH - Diamond Sparkling Frame) ================== */
.badge-tier-4 {
    background: linear-gradient(125deg, #f0f9ff 0%, #bae6fd 15%, #c084fc 35%, #ffffff 50%, #38bdf8 68%, #f472b6 82%, #0284c7 100%);
    background-size: 280% 280%;
    animation: diamondHolo 3.6s ease infinite;
    color: #082f49;
    border: 2px solid #0284c7;
    outline: 1.8px solid rgba(56, 189, 248, 0.85);
    outline-offset: 1.5px;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.7), 0 0 24px rgba(192, 132, 252, 0.5), inset 0 1.5px 2px #ffffff, inset 0 -1px 2px rgba(2, 132, 199, 0.3);
    font-weight: 800;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.95);
}

.badge-tier-4:hover {
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.95), 0 0 30px rgba(192, 132, 252, 0.8), inset 0 2px 2px #ffffff;
    transform: scale(1.02);
}

.badge-tier-4 .badge-icon {
    color: #0284c7;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.95));
}

@keyframes diamondHolo {
    0% { background-position: 0% 50%; box-shadow: 0 0 16px rgba(56, 189, 248, 0.7), 0 0 24px rgba(192, 132, 252, 0.5), inset 0 1.5px 2px #ffffff; }
    50% { background-position: 100% 50%; box-shadow: 0 0 26px rgba(56, 189, 248, 0.95), 0 0 32px rgba(244, 114, 182, 0.75), inset 0 2px 3px #ffffff; }
    100% { background-position: 0% 50%; box-shadow: 0 0 16px rgba(56, 189, 248, 0.7), 0 0 24px rgba(192, 132, 252, 0.5), inset 0 1.5px 2px #ffffff; }
}

/* ================== KHUNG VIỀN AVATAR LUXURY THEO CẤP BẬC ================== */
.avatar-frame,
img.rounded-circle.border,
div.rounded-circle.border {
    border: 1.8px solid #cbd5e1 !important;
    box-sizing: border-box !important;
    transition: all 0.25s ease-in-out;
}

/* CẤP 1: NGƯỜI TỬ TẾ (Khung Đồng Ánh Kim) */
.avatar-ring-tier-1 {
    border: 2px solid #b45309 !important;
    outline: 1.5px solid #fb923c !important;
    outline-offset: 1px !important;
    box-shadow: 0 1px 4px rgba(180, 83, 9, 0.35) !important;
    box-sizing: border-box !important;
}

/* CẤP 2: NGHĨA HIỆP (Khung Bạc Bạch Kim) */
.avatar-ring-tier-2 {
    border: 2px solid #64748b !important;
    outline: 1.5px solid #cbd5e1 !important;
    outline-offset: 1px !important;
    box-shadow: 0 1px 4px rgba(100, 116, 139, 0.35) !important;
    box-sizing: border-box !important;
}

/* CẤP 3: HIỆP SĨ (Khung Hoàng Gia 24K Gold) */
.avatar-ring-tier-3 {
    border: 2.2px solid #b45309 !important;
    outline: 2px solid #f59e0b !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5) !important;
    box-sizing: border-box !important;
}

/* CẤP 4: NGƯỜI HÙNG (Khung Kim Cương Hologram VIP) */
.avatar-ring-tier-4 {
    border: 2.2px solid #0284c7 !important;
    outline: 2px solid #38bdf8 !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6), 0 0 12px rgba(192, 132, 252, 0.4) !important;
    animation: diamondAvatarRing 3s ease-in-out infinite alternate !important;
    box-sizing: border-box !important;
}

@keyframes diamondAvatarRing {
    0% {
        outline-color: #38bdf8;
        border-color: #0284c7;
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.6), 0 0 12px rgba(192, 132, 252, 0.4);
    }
    50% {
        outline-color: #c084fc;
        border-color: #7c3aed;
        box-shadow: 0 0 10px rgba(192, 132, 252, 0.7), 0 0 14px rgba(244, 114, 182, 0.5);
    }
    100% {
        outline-color: #f472b6;
        border-color: #0284c7;
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.6), 0 0 12px rgba(192, 132, 252, 0.4);
    }
}

/* Khung avatar kích cỡ lớn (Profile & Sidebar) */
.avatar-lg.avatar-ring-tier-1,
.avatar-ring-tier-1[style*="86px"],
.avatar-ring-tier-1[style*="90px"],
.avatar-ring-tier-1[style*="100px"] {
    border-width: 3.5px !important;
    outline-width: 2.5px !important;
    outline-offset: 2px !important;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3) !important;
}

.avatar-lg.avatar-ring-tier-2,
.avatar-ring-tier-2[style*="86px"],
.avatar-ring-tier-2[style*="90px"],
.avatar-ring-tier-2[style*="100px"] {
    border-width: 3.5px !important;
    outline-width: 2.5px !important;
    outline-offset: 2px !important;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3) !important;
}

.avatar-lg.avatar-ring-tier-3,
.avatar-ring-tier-3[style*="86px"],
.avatar-ring-tier-3[style*="90px"],
.avatar-ring-tier-3[style*="100px"] {
    border-width: 4px !important;
    outline-width: 3px !important;
    outline-offset: 2.5px !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

.avatar-lg.avatar-ring-tier-4,
.avatar-ring-tier-4[style*="86px"],
.avatar-ring-tier-4[style*="90px"],
.avatar-ring-tier-4[style*="100px"] {
    border-width: 4px !important;
    outline-width: 3px !important;
    outline-offset: 2.5px !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.6), 0 0 24px rgba(192, 132, 252, 0.4) !important;
}

/* Khung avatar kích cỡ nhỏ (Trong thẻ bài viết & dropdown) */
.post-card .avatar-ring-tier-1,
.size-xs .avatar-ring-tier-1 {
    border-width: 1.8px !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #fb923c !important;
}
.post-card .avatar-ring-tier-2,
.size-xs .avatar-ring-tier-2 {
    border-width: 1.8px !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #cbd5e1 !important;
}
.post-card .avatar-ring-tier-3,
.size-xs .avatar-ring-tier-3 {
    border-width: 2px !important;
    outline: none !important;
    box-shadow: 0 0 0 1.2px #f59e0b !important;
}
.post-card .avatar-ring-tier-4,
.size-xs .avatar-ring-tier-4 {
    border-width: 2px !important;
    outline: none !important;
    box-shadow: 0 0 0 1.2px #38bdf8 !important;
}

/* ================== TÊN NGƯỜI DÙNG & KHOẢNG CÁCH BẢNG HIỆU VỪA VẶN ================== */
.user-name-badge-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 6px;
    vertical-align: middle;
    max-width: 100%;
    min-width: 0;
}

.user-name-badge-wrap .user-normal-name {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.25;
    font-weight: 700;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
}

.user-name-badge-wrap .badge-reputation {
    margin: 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.user-normal-name {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.25;
    font-weight: 700;
}

.user-luxury-frame {
    display: inline-flex;
    align-items: center;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.user-luxury-frame .luxury-frame-name {
    display: inline-block;
    vertical-align: middle;
    font-weight: 700;
}
.user-luxury-frame .luxury-frame-sheen {
    display: none !important;
}

/* ================== KHUNG NGÀY THAM GIA LUXURY VIP ================== */
.luxury-join-card {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 13px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
    transition: all 0.3s ease;
}

.luxury-join-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4.5px;
    height: 100%;
    background: linear-gradient(180deg, #f59e0b 0%, #3b82f6 50%, #8b5cf6 100%);
}

.luxury-join-card:hover {
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15), inset 0 1px 0 #ffffff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.luxury-join-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(191, 219, 254, 0.8);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
    flex-shrink: 0;
}

.luxury-join-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    line-height: 1.2;
}

.luxury-join-date {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.luxury-join-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #047857;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    padding: 3px 9px;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
    white-space: nowrap;
}

/* ================== MENU TÀI KHOẢN TRẢI DÀI TRÊN ĐIỆN THOẠI ================== */
.mobile-user-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

.mobile-nav-item:hover,
.mobile-nav-item:active,
.mobile-nav-item:focus {
    background: #f1f5f9;
    color: #0f172a;
}

.mobile-nav-item.admin-highlight {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    color: #854d0e;
    border: 1px solid #fef08a;
}

.mobile-nav-item.admin-highlight:hover {
    background: #fef08a;
    color: #713f12;
}

.mobile-nav-item.text-danger:hover {
    background: #fef2f2;
    color: #b91c1c !important;
}

.mobile-nav-item.active {
    background: #e0f2fe;
    color: #0369a1 !important;
    font-weight: 700;
}

.mobile-nav-item.active.text-success {
    background: #dcfce7;
    color: #15803d !important;
}

.mobile-nav-item.active.text-danger {
    background: #fee2e2;
    color: #b91c1c !important;
}

.mobile-nav-item.active.admin-highlight {
    background: #fef08a;
    color: #713f12 !important;
    border-color: #eab308;
}

.navbar-nav .nav-link.active {
    color: #0d6efd !important;
    font-weight: 700 !important;
}

.navbar-nav .nav-link.text-success.active {
    color: #198754 !important;
    font-weight: 700 !important;
}

.navbar-nav .nav-link.text-danger.active {
    color: #dc3545 !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   LINH VẬT CÓC FPT TƯƠNG TÁC (INTERACTIVE FROG MASCOT)
   - Nhìn theo chuột 8 hướng + tâm
   - Chớp mắt tự nhiên định kỳ
   - Tương tác nhắm mắt khi nhập mật khẩu (Password Focus / Input)
   ========================================================================== */
.frog-interactive-mascot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.frog-interactive-mascot .frog-interactive-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    transition: transform 0.15s ease;
}

.frog-interactive-mascot .frog-interactive-eyelids {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.frog-interactive-mascot .frog-eyelid-path {
    transform-origin: 50% 0%;
    transform: scaleY(0);
    transition: transform 90ms ease-in;
    will-change: transform;
}

/* Khi cóc chớp mắt hoặc nhắm mắt che mật khẩu */
.frog-interactive-mascot.is-blinking .frog-eyelid-path,
.frog-interactive-mascot.is-closed .frog-eyelid-path {
    transform: scaleY(1);
    transition: transform 120ms ease-out;
}

/* Hiệu ứng thở nhẹ khi đứng yên */
.frog-interactive-mascot.has-breathe {
    animation: frogGentleBreathe 3s ease-in-out infinite;
}

@keyframes frogGentleBreathe {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-1.5px); }
}

/* Khung linh vật cóc trang đăng nhập */
.login-frog-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.login-frog-mascot {
    width: 80px;
    height: 80px;
    transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.login-frog-mascot.is-shy {
    transform: scale(0.96) translateY(2px);
}

