/*
 * CSS Variables mặc định (fallback).
 * --rv-primary, --rv-secondary, --rv-bg-vip, --rv-border-vip
 * sẽ được ghi đè bởi Admin Settings qua functions.php (wp_add_inline_style).
 */
:root {
    --rv-primary: #198754;
    --rv-primary-hover: #0d6832;
    --rv-primary-light: #3eaf76;
    --rv-primary-rgb: 25, 135, 84;
    --rv-secondary: #ffc107;
    --rv-secondary-hover: #e8ac00;
    --rv-bg-vip: rgba(var(--rv-primary-rgb), 0.08);
    --rv-border-vip: rgba(var(--rv-primary-rgb), 0.25);
    
    /* Light Mode Variables */
    --rv-bg-body: #f8f9fa;
    --rv-bg-card: #ffffff;
    --rv-border-card: #e0e0e0;
    --rv-bg-header: #ffffff;
    --rv-border-header: #e8f5e9;
    --rv-bg-search: #f1f3f4;
    --rv-text-dark: #212529;
    --rv-text-muted: #6c757d;
    --rv-bg-dropdown: #ffffff;
    --rv-border-dropdown: #f1f5f9;
    --rv-text-dropdown: #212529;
    
    --rv-transition-theme: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --rv-bg-body: #0f172a; /* Slate 900 */
    --rv-bg-card: #1e293b; /* Slate 800 */
    --rv-border-card: #334155; /* Slate 700 */
    --rv-bg-header: #1e293b; /* Slate 800 */
    --rv-border-header: #334155; /* Slate 700 */
    --rv-bg-search: #334155; /* Slate 700 */
    --rv-text-dark: #f8fafc; /* Slate 50 */
    --rv-text-muted: #94a3b8; /* Slate 400 */
    --rv-bg-dropdown: #1e293b; /* Slate 800 */
    --rv-border-dropdown: #334155; /* Slate 700 */
    --rv-text-dropdown: #f8fafc; /* Slate 50 */
    
    --rv-bg-vip: rgba(var(--rv-primary-rgb), 0.15);
    --rv-border-vip: rgba(var(--rv-primary-rgb), 0.4);
}

body {
    background-color: var(--rv-bg-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--rv-text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--rv-transition-theme);
}

footer {
    margin-top: auto !important;
}

/* Rounded and smooth styles */
.btn-primary-green {
    background-color: var(--rv-primary);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
}
.btn-primary-green:hover {
    background-color: var(--rv-primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

.card-listing {
    border: 1px solid var(--rv-border-card);
    background-color: var(--rv-bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--rv-transition-theme), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.card-listing:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--rv-text-muted);
}

/* VIP Highlight */
.card-listing-vip {
    background-color: var(--rv-bg-vip);
    border: 1px solid var(--rv-border-vip);
}
.card-listing-vip:hover {
    border-color: var(--rv-primary);
}

/* Circle category items */
.cat-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--rv-text-dark);
    transition: transform 0.2s ease;
}
.cat-circle-item:hover {
    transform: scale(1.05);
    color: var(--rv-primary);
}
.cat-circle-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rv-primary);
    font-size: 28px;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.1);
    transition: all 0.2s ease;
}
.cat-circle-item:hover .cat-circle-icon {
    background: var(--rv-primary);
    color: #fff;
}
.cat-circle-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Micro animations */
.cursor-pointer {
    cursor: pointer;
}
.transition-3 {
    transition: all 0.3s ease;
}

/* ==========================================================================
   DYNAMIC STYLE OVERRIDES (Using CSS variables injected via functions.php)
   ========================================================================== */
.text-success {
    color: var(--rv-primary) !important;
}
.btn-success {
    background-color: var(--rv-primary) !important;
    border-color: var(--rv-primary) !important;
}
.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: var(--rv-primary-hover) !important;
    border-color: var(--rv-primary-hover) !important;
}
.btn-outline-success {
    color: var(--rv-primary) !important;
    border-color: var(--rv-primary) !important;
}
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active,
.btn-check:checked + .btn-outline-success,
.btn-check:active + .btn-outline-success {
    background-color: var(--rv-primary) !important;
    border-color: var(--rv-primary) !important;
    color: #fff !important;
}

/* Listings AJAX loading overlay */
.rv-listings-loading {
    position: relative;
    pointer-events: none;
}
.rv-listings-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    transition: all 0.3s ease;
    border-radius: 12px;
}
.rv-listings-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 3px solid rgba(var(--rv-primary-rgb), 0.2);
    border-top-color: var(--rv-primary);
    border-radius: 50%;
    animation: rv-spin 0.8s linear infinite;
    z-index: 51;
}

@keyframes rv-spin {
    to {
        transform: rotate(360deg);
    }
}
.border-success {
    border-color: var(--rv-primary) !important;
}
.bg-success {
    background-color: var(--rv-primary) !important;
}
.link-success {
    color: var(--rv-primary) !important;
}
.link-success:hover {
    color: var(--rv-primary-hover) !important;
}

.btn-warning {
    background-color: var(--rv-secondary) !important;
    border-color: var(--rv-secondary) !important;
    color: #ffffff !important;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--rv-secondary-hover) !important;
    border-color: var(--rv-secondary-hover) !important;
    color: #ffffff !important;
}

.rv-auth-page-container .form-control:focus {
    border-color: var(--rv-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--rv-primary-rgb), 0.12) !important;
}
.rv-wallet-pkg:hover {
    border-color: var(--rv-primary) !important;
}
.rv-wallet-pkg.active {
    border-color: var(--rv-primary) !important;
    background-color: var(--rv-bg-vip) !important;
}
.rv-wallet-pkg .rv-pkg-points {
    color: var(--rv-primary) !important;
}
.rv-wallet-pkg .check-icon {
    color: var(--rv-primary) !important;
}
.rv-pagination a, .rv-pagination span {
    color: var(--rv-primary) !important;
}
.rv-pagination a:hover {
    background-color: var(--rv-bg-vip) !important;
    border-color: var(--rv-primary) !important;
    color: var(--rv-primary) !important;
}
.rv-pagination span.current {
    background-color: var(--rv-primary) !important;
    border-color: var(--rv-primary) !important;
    color: #fff !important;
}
.rv-avatar.bg-success {
    background-color: var(--rv-primary) !important;
}

/* ===== Bootstrap Pagination Override (Category page) ===== */
.pagination .page-item.active .page-link {
    background-color: var(--rv-primary) !important;
    border-color: var(--rv-primary) !important;
    color: #fff !important;
}
.pagination .page-link {
    color: var(--rv-primary);
}
.pagination .page-link:hover {
    color: var(--rv-primary-hover);
    background-color: var(--rv-bg-vip);
    border-color: var(--rv-primary);
}

/* ===== Dashicon Alignment Fix ===== */
.rv-dashboard-wrapper .dashicons,
.table .dashicons,
.small-icon {
    vertical-align: middle !important;
    line-height: 1;
}

/* ===== LIGHTBOX FOR SLIDESHOW ===== */
.rv-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show Lightbox state */
.rv-lightbox.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.rv-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.rv-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    z-index: 1052;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 10px;
}
.rv-lightbox-close:hover {
    color: #ffffff;
    transform: scale(1.1);
}
.rv-lightbox-close:focus {
    outline: none;
}

.rv-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    height: 80%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1051;
}

.rv-lightbox-image-container {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
}

.rv-lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Zoom/Fade-in image animation when loaded and active */
.rv-lightbox-image-container img.loaded {
    opacity: 1;
    transform: scale(1);
}

.rv-lightbox-nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}
.rv-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}
.rv-lightbox-nav:active {
    transform: scale(0.95);
}
.rv-lightbox-nav .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-lightbox-counter {
    position: absolute;
    bottom: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    z-index: 1051;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 1px;
}

/* Spinner Loading */
.rv-lightbox-spinner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--rv-primary);
    border-radius: 50%;
    animation: rv-spin 0.8s linear infinite;
    display: none;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .rv-lightbox-content {
        height: 70%;
        width: 95%;
    }
    .rv-lightbox-image-container {
        margin: 0;
    }
    .rv-lightbox-nav {
        width: 46px;
        height: 46px;
        position: absolute;
        bottom: -70px;
    }
    .rv-lightbox-prev {
        left: calc(50% - 60px);
    }
    .rv-lightbox-next {
        right: calc(50% - 60px);
    }
    .rv-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 36px;
    }
}

/* Custom Carousel Controls for Single Listing Details Slider */
#listingImagesCarousel .carousel-control-prev,
#listingImagesCarousel .carousel-control-next {
    width: 44px;
    height: 44px;
    top: calc(50% - 22px);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5); /* Slate 900 semi-transparent */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    opacity: 0.85;
    transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#listingImagesCarousel .carousel-control-prev {
    left: 20px;
}

#listingImagesCarousel .carousel-control-next {
    right: 20px;
}

#listingImagesCarousel .carousel-control-prev:hover,
#listingImagesCarousel .carousel-control-next:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(255, 255, 255, 0.4);
    opacity: 1;
    color: #ffffff;
    transform: scale(1.08);
}

#listingImagesCarousel .carousel-control-prev:active,
#listingImagesCarousel .carousel-control-next:active {
    transform: scale(0.95);
}

#listingImagesCarousel .carousel-control-prev .dashicons,
#listingImagesCarousel .carousel-control-next .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   SUPPORT TICKET SYSTEM & CHAT BUBBLES
   ========================================================================== */
.rv-support-wrapper .nav-pills .nav-link {
    background-color: #f1f5f9;
    color: #475569;
    transition: all 0.3s ease;
}
.rv-support-wrapper .nav-pills .nav-link.active {
    background-color: var(--rv-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(var(--rv-primary-rgb), 0.2);
}
.rv-support-wrapper .table th {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}
.rv-support-wrapper .table td {
    padding: 1rem 0.75rem;
    font-size: 14.5px;
}
.hover-text-success:hover {
    color: var(--rv-primary) !important;
}

/* Chat bubble styling */
.rv-ticket-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 1rem;
    border: 1px dashed #cbd5e1;
    max-height: 600px;
    overflow-y: auto;
}
.rv-chat-bubble-container {
    display: flex;
    flex-direction: column;
}
.shadow-sm-hover {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.shadow-sm-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-1px);
}
.rounded-start-4 {
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
}
.rounded-end-4 {
    border-top-right-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}
.rounded-bottom-4 {
    border-bottom-left-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}

/* Scrollbar styling for chat container */
.rv-ticket-chat-thread::-webkit-scrollbar {
    width: 6px;
}
.rv-ticket-chat-thread::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.rv-ticket-chat-thread::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.rv-ticket-chat-thread::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Style for wp_editor on frontend */
.rv-wp-editor-wrapper .wp-editor-container {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}
.rv-wp-editor-wrapper .wp-editor-tools {
    border-bottom: 1px solid #cbd5e1;
    background-color: #f8fafc;
}
.rv-wp-editor-wrapper .quicktags-toolbar {
    border-bottom: 1px solid #cbd5e1;
    background: #f1f5f9;
}
.rv-wp-editor-wrapper .wp-textarea-wrap textarea {
    border: none !important;
    padding: 10px !important;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.navbar-custom {
    background-color: var(--rv-bg-header);
    border-bottom: 2px solid var(--rv-border-header);
    transition: var(--rv-transition-theme);
}
.search-container {
    background-color: var(--rv-bg-search);
    border-radius: 30px;
    padding: 2px 10px;
    display: flex;
    align-items: center;
    transition: var(--rv-transition-theme);
}
.search-container input {
    background: transparent;
    border: none;
    box-shadow: none !important;
    font-size: 14px;
    color: var(--rv-text-dark);
}
.search-container button {
    background: transparent;
    border: none;
    color: var(--rv-primary);
}
.header-btn-post {
    border-radius: 20px;
    font-weight: 600;
    padding: 8px 20px;
    font-size: 14px;
    background-color: var(--rv-secondary);
    border: 1px solid var(--rv-secondary);
    color: #ffffff !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.header-btn-post span {
    white-space: nowrap;
}
.header-btn-post:hover {
    background-color: var(--rv-secondary-hover);
    transform: translateY(-1px);
}
.wallet-badge {
    background-color: var(--rv-bg-search);
    color: var(--rv-primary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--rv-transition-theme);
    white-space: nowrap;
    flex-shrink: 0;
}
.wallet-badge span {
    white-space: nowrap;
}
.wallet-badge:hover {
    background-color: var(--rv-primary);
    color: #fff;
}

/* ===== Search Autocomplete Suggestions ===== */
.search-wrapper {
    position: relative;
}
.rv-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--rv-bg-dropdown);
    border: 1px solid var(--rv-border-dropdown);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    padding: 8px 0;
    z-index: 1050;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    transition: var(--rv-transition-theme);
}
.rv-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--rv-text-dark) !important;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--rv-border-dropdown);
}
.rv-suggestion-item:last-child {
    border-bottom: none;
}
.rv-suggestion-item:hover {
    background-color: rgba(16, 185, 129, 0.05);
}
.rv-suggestion-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.rv-suggestion-no-image {
    width: 48px;
    height: 48px;
    background-color: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.rv-suggestion-info {
    flex-grow: 1;
    min-width: 0;
}
.rv-suggestion-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--rv-text-dark);
}
.rv-suggestion-price {
    font-size: 13px;
    font-weight: 700;
    color: #dc3545;
    margin: 0;
}
.rv-suggestion-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ===== Notifications Dropdown ===== */
.rv-notifications-dropdown .dropdown-menu {
    width: 340px;
    max-height: 450px;
    overflow: hidden;
    border: 1px solid var(--rv-border-dropdown);
    background-color: var(--rv-bg-dropdown);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border-radius: 12px;
}
.rv-notification-list {
    max-height: 320px;
    overflow-y: auto;
}
.rv-notification-item {
    border-bottom: 1px solid var(--rv-border-dropdown);
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    color: var(--rv-text-muted);
    transition: all 0.2s ease;
}
.rv-notification-item:last-child {
    border-bottom: none;
}
.rv-notification-item:hover {
    background-color: var(--rv-bg-search);
    color: var(--rv-text-dark);
}
.rv-notification-item-unread {
    background-color: rgba(25, 135, 84, 0.04);
    font-weight: 600;
}
.rv-notification-item-unread:hover {
    background-color: rgba(25, 135, 84, 0.08) !important;
}
.rv-notification-bell {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--rv-bg-search);
    color: var(--rv-text-muted);
    transition: var(--rv-transition-theme);
    position: relative;
    flex-shrink: 0;
}
.rv-notification-bell:hover {
    background-color: var(--rv-border-card);
    color: var(--rv-primary);
}

/* ==========================================================================
   DARK MODE OVERRIDES & PREMIUM DESIGN SCHEME
   ========================================================================== */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .bg-white {
    background-color: var(--rv-bg-card) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--rv-bg-search) !important;
}

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

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

/* Bootstrap Card styling */
[data-theme="dark"] .card {
    background-color: var(--rv-bg-card) !important;
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark);
}

/* Form Controls styling */
[data-theme="dark"] .form-control,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--rv-bg-search) !important;
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background-color: var(--rv-bg-search) !important;
    border-color: var(--rv-primary) !important;
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .form-control::placeholder {
    color: var(--rv-text-muted) !important;
    opacity: 0.65;
}

/* Modals */
[data-theme="dark"] .modal-content {
    background-color: var(--rv-bg-card) !important;
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--rv-border-card) !important;
}
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

/* Dropdown Menu overrides */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--rv-bg-dropdown) !important;
    border-color: var(--rv-border-dropdown) !important;
    color: var(--rv-text-dropdown) !important;
}
[data-theme="dark"] .dropdown-item {
    color: var(--rv-text-dropdown) !important;
}
[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .dropdown-divider {
    border-color: var(--rv-border-card) !important;
}

/* Tables */
[data-theme="dark"] .table {
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: var(--rv-text-dark) !important;
}

/* List Groups */
[data-theme="dark"] .list-group-item {
    background-color: var(--rv-bg-card) !important;
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}
[data-theme="dark"] .list-group-item-action:hover {
    background-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}

/* Category Icons */
[data-theme="dark"] .cat-circle-icon {
    background: rgba(25, 135, 84, 0.2);
}

/* Custom alerts */
[data-theme="dark"] .alert-warning {
    background-color: #2c1e05 !important;
    border-color: #ffc107 !important;
    color: #ffe082 !important;
}
[data-theme="dark"] .alert-success {
    background-color: #0b2d18 !important;
    border-color: var(--rv-primary) !important;
    color: #a3cfbb !important;
}

/* Support system chat */
[data-theme="dark"] .rv-ticket-chat-thread {
    background-color: #1e293b !important;
    border-color: var(--rv-border-card) !important;
}
[data-theme="dark"] .rv-wp-editor-wrapper .wp-editor-container {
    border-color: var(--rv-border-card) !important;
}
[data-theme="dark"] .rv-wp-editor-wrapper .wp-editor-tools,
[data-theme="dark"] .rv-wp-editor-wrapper .quicktags-toolbar {
    background-color: #334155 !important;
    border-color: var(--rv-border-card) !important;
}

/* Spinners */
[data-theme="dark"] .rv-listings-loading::after {
    background: rgba(15, 23, 42, 0.7) !important;
}

/* SVG Theme Toggle hover transitions */
.theme-toggle-btn:hover {
    background-color: var(--rv-border-card) !important;
    color: var(--rv-primary) !important;
    transform: scale(1.05);
}
.theme-toggle-btn svg {
    transition: transform 0.3s ease;
}
.theme-toggle-btn:active svg {
    transform: rotate(45deg) scale(0.95);
}

/* Dark Mode Hero & VIP Card overrides */
[data-theme="dark"] #homeBannerCarousel .carousel-item.hero-default-bg {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}

[data-theme="dark"] .card-listing-vip {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

/* ==========================================================================
   MOBILE MENU PANEL
   ========================================================================== */
.mobile-menu-panel {
    background-color: var(--rv-bg-card);
    border: 1px solid var(--rv-border-card);
    color: var(--rv-text-dark);
    transition: var(--rv-transition-theme);
}

.mobile-menu-panel .list-group-item {
    background-color: transparent !important;
    border-color: var(--rv-border-card) !important;
    color: var(--rv-text-dark) !important;
}

.mobile-menu-panel .list-group-item-action:hover,
.mobile-menu-panel .list-group-item-action:focus {
    background-color: var(--rv-bg-search) !important;
    color: var(--rv-text-dark) !important;
}

.mobile-menu-panel .border-bottom {
    border-color: var(--rv-border-card) !important;
}

/* Mobile notification panel inside menu */
.mobile-menu-panel .rv-notification-list-mobile {
    background-color: var(--rv-bg-card) !important;
    border-color: var(--rv-border-card) !important;
}

/* ===== Global border override for dark mode ===== */
[data-theme="dark"] .border {
    border-color: var(--rv-border-card) !important;
}
[data-theme="dark"] .border-bottom {
    border-bottom-color: var(--rv-border-card) !important;
}
[data-theme="dark"] .border-top {
    border-top-color: var(--rv-border-card) !important;
}

/* Badge inside listing cards */
[data-theme="dark"] .badge.bg-light {
    background-color: var(--rv-bg-search) !important;
    color: var(--rv-text-muted) !important;
}

/* Dashboard listing item hover */
[data-theme="dark"] .rv-listing-item:hover {
    background-color: var(--rv-bg-search) !important;
}

/* Wallet package hover */
[data-theme="dark"] .rv-wallet-pkg:hover {
    background-color: var(--rv-bg-search) !important;
}



/* ==========================================================
   XỨ NGHỆ.NET - GIAO DIỆN DANH MỤC TIN TỨC / BLOG
   ========================================================== */

/* Khu vực tổng thể */
.xunghe-blog-archive {
    padding: 30px 0 50px;
    background: #f8faf9;
    min-height: 400px;
}

/* Tiêu đề danh mục */
.xunghe-blog-heading {
    margin-bottom: 25px;
}

.xunghe-blog-heading-title {
    font-size: 26px;
    font-weight: 800;
    color: #198754;
    margin: 0 0 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5eee8;
}

.xunghe-blog-category-description {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
}

/* Danh sách bài viết */
.xunghe-blog-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Khung mỗi bài viết */
.xunghe-blog-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #edf0ed;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    margin: 0;
}

.xunghe-blog-item:hover {
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Cột ảnh đại diện */
.xunghe-blog-thumbnail {
    flex: 0 0 220px;
    width: 220px;
    overflow: hidden;
    border-radius: 9px;
    background: #f0f3f1;
}

.xunghe-blog-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.xunghe-blog-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 150px;
    max-height: 165px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.xunghe-blog-item:hover .xunghe-blog-image {
    transform: scale(1.04);
}

/* Ảnh mặc định khi bài viết chưa có ảnh */
.xunghe-blog-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 150px;
    background: #eaf3ed;
    color: #198754;
    font-size: 40px;
}

/* Cột nội dung */
.xunghe-blog-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

/* Tiêu đề bài viết */
.xunghe-blog-title {
    margin: 0;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 700;
}

.xunghe-blog-title a {
    color: #252b27;
    text-decoration: none;
    transition: color 0.2s ease;
}

.xunghe-blog-title a:hover {
    color: #198754;
}

/* Hàng thông tin: ngày - danh mục - tác giả */
.xunghe-blog-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: #858b87;
    font-size: 12px;
    line-height: 1.6;
}

.xunghe-blog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.xunghe-blog-meta-item .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #198754;
}

.xunghe-blog-meta-item a {
    color: #198754;
    text-decoration: none;
}

.xunghe-blog-meta-item a:hover {
    text-decoration: underline;
}

/* Đoạn tóm tắt */
.xunghe-blog-excerpt {
    color: #606963;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 2px;
}

/* Phân trang */
.xunghe-blog-pagination {
    margin-top: 30px;
    text-align: center;
}

.xunghe-blog-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 7px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.xunghe-blog-pagination li {
    margin: 0;
}

.xunghe-blog-pagination a,
.xunghe-blog-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #e5eae6;
    color: #198754;
    text-decoration: none;
    font-size: 14px;
}

.xunghe-blog-pagination .current {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.xunghe-blog-pagination a:hover {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

/* Không có bài viết */
.xunghe-blog-empty {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    color: #888;
}


/* ==========================================================
   RESPONSIVE - TABLET
   ========================================================== */

@media (max-width: 767px) {

    .xunghe-blog-archive {
        padding: 20px 0 35px;
    }

    .xunghe-blog-heading-title {
        font-size: 22px;
    }

    .xunghe-blog-item {
        gap: 12px;
        padding: 11px;
    }

    .xunghe-blog-thumbnail {
        flex: 0 0 135px;
        width: 135px;
    }

    .xunghe-blog-image {
        min-height: 105px;
        max-height: 120px;
    }

    .xunghe-blog-no-image {
        min-height: 105px;
    }

    .xunghe-blog-title {
        font-size: 16px;
        line-height: 1.4;
    }

    .xunghe-blog-content {
        gap: 7px;
    }

    .xunghe-blog-excerpt {
        font-size: 12px;
        line-height: 1.55;
    }

    .xunghe-blog-meta {
        gap: 4px 10px;
        font-size: 11px;
    }
}


/* ==========================================================
   RESPONSIVE - ĐIỆN THOẠI MÀN HÌNH NHỎ
   ========================================================== */

@media (max-width: 400px) {

    .xunghe-blog-item {
        gap: 9px;
        padding: 9px;
    }

    .xunghe-blog-thumbnail {
        flex: 0 0 105px;
        width: 105px;
    }

    .xunghe-blog-image {
        min-height: 95px;
        max-height: 110px;
    }

    .xunghe-blog-no-image {
        min-height: 95px;
    }

    .xunghe-blog-title {
        font-size: 14px;
    }

    .xunghe-blog-meta {
        gap: 3px 8px;
        font-size: 10px;
    }

    .xunghe-blog-excerpt {
        font-size: 11px;
    }
}


/* ==========================================================
   XỨ NGHỆ.NET - BLOG LAYOUT 9:3
   KHUNG NỘI DUNG CHÍNH + SIDEBAR
   ========================================================== */

/* Khung chia 2 cột */
.xunghe-blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
    gap: 20px;
    align-items: start;
}

/* Khung nội dung chính bên trái */
.xunghe-blog-main-panel,
.xunghe-blog-single-panel {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e9e4;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.045);
}


/* Điều chỉnh phần tiêu đề danh mục */
.xunghe-blog-main-panel .xunghe-blog-heading {
    margin-bottom: 22px;
}

/* Các bài viết bên trong khung chính */
.xunghe-blog-main-panel .xunghe-blog-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Khung sidebar bên phải */
.xunghe-blog-sidebar-panel {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e9e4;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.045);
}

/* Nội dung bên trong sidebar */
.xunghe-blog-sidebar-inner {
    width: 100%;
}

/* Từng widget */
.xunghe-blog-widget {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf0ed;
}

.xunghe-blog-widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

/* Tiêu đề widget */
.xunghe-blog-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #198754;
    padding-bottom: 10px;
    margin: 0 0 14px;
    border-bottom: 2px solid #e7f1e9;
}

/* Widget không có nội dung */
.xunghe-blog-sidebar-empty {
    color: #777;
    font-size: 13px;
    line-height: 1.7;
}

.xunghe-blog-sidebar-empty strong {
    display: block;
    color: #198754;
    font-size: 16px;
    margin-bottom: 8px;
}


/* ==========================================================
   BÀI VIẾT ĐƠN
   ========================================================== */

.xunghe-blog-single {
    padding: 30px 0 50px;
    background: #f8faf9;
}

/* Tiêu đề bài viết */
.xunghe-blog-single-title {
    font-size: 28px;
    line-height: 1.45;
    font-weight: 800;
    color: #252b27;
    margin: 0 0 15px;
}

/* Hàng thông tin bài viết */
.xunghe-blog-single-meta {
    margin-bottom: 22px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf0ed;
}

/* Ảnh đại diện bài viết */
.xunghe-blog-single-thumbnail {
    margin-bottom: 25px;
    text-align: center;
}

.xunghe-blog-single-image {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Nội dung bài viết */
.xunghe-blog-single-content {
    color: #343a36;
    font-size: 16px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.xunghe-blog-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.xunghe-blog-single-content h2,
.xunghe-blog-single-content h3,
.xunghe-blog-single-content h4 {
    color: #198754;
    line-height: 1.5;
    margin-top: 25px;
    margin-bottom: 12px;
}

.xunghe-blog-single-content p {
    margin-bottom: 18px;
}

.xunghe-blog-single-content a {
    color: #198754;
}

.xunghe-blog-single-content blockquote {
    border-left: 4px solid #198754;
    background: #f4f8f5;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

/* Tags bài viết */
.xunghe-blog-tags {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #edf0ed;
    font-size: 13px;
}

.xunghe-blog-tags a {
    color: #198754;
    text-decoration: none;
}


/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 991px) {

    .xunghe-blog-layout {
        grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr);
        gap: 15px;
    }

    .xunghe-blog-main-panel,
    .xunghe-blog-single-panel {
        padding: 16px;
    }

    .xunghe-blog-sidebar-panel {
        padding: 14px;
    }

    .xunghe-blog-single-title {
        font-size: 24px;
    }
}


/* ==========================================================
   ĐIỆN THOẠI
   ========================================================== */

@media (max-width: 767px) {

    /* Hai khung chuyển thành hai hàng */
    .xunghe-blog-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .xunghe-blog-main-panel,
    .xunghe-blog-single-panel {
        padding: 13px;
        border-radius: 11px;
    }

    .xunghe-blog-sidebar-panel {
        padding: 15px;
        border-radius: 11px;
    }

    .xunghe-blog-single-title {
        font-size: 21px;
    }

    .xunghe-blog-single-content {
        font-size: 15px;
    }
}
