/* JustReused, Dark theme surface fixes (messaging, analytics, listing, admin, post-ad)
   Load after jr-theme-compat.css */

/* ═══════════════════════════════════════════════════════════
   MESSAGING / INBOX
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] .messenger-container {
    background: #181818 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}

[data-jr-theme="spotify"] .conversation-panel {
    background: #121212 !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .chat-panel {
    background: #181818 !important;
}

[data-jr-theme="spotify"] .messenger-wrapper {
    background: #121212 !important;
}

[data-jr-theme="spotify"] .jr-chat-empty-state {
    background: #181818 !important;
}

[data-jr-theme="spotify"] .jr-chat-empty-icon {
    background: #282828 !important;
}

[data-jr-theme="spotify"] .jr-chat-panel,
[data-jr-theme="spotify"] .jr-chat-header {
    background: #181818 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .jr-chat-messages,
[data-jr-theme="spotify"] #chat-box-container {
    background: #121212 !important;
}

[data-jr-theme="spotify"] .jr-conv-list,
[data-jr-theme="spotify"] .jr-conv-list-header {
    background: #181818 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .jr-conv-item-active {
    background: rgba(243, 152, 26, 0.12) !important;
}

[data-jr-theme="spotify"] .jr-conv-item:hover {
    background: #242424 !important;
}

/* Empty chat state, kill white gradient */
[data-jr-theme="spotify"] .chat-panel .bg-gradient-to-br,
[data-jr-theme="spotify"] .chat-panel [class*="from-gray-50"],
[data-jr-theme="spotify"] .chat-panel [class*="to-orange-50"] {
    background: #181818 !important;
    background-image: none !important;
}

[data-jr-theme="spotify"] .chat-panel .bg-gradient-to-br .bg-white {
    background: #282828 !important;
}

[data-jr-theme="spotify"] [class*="from-white"][class*="to-"] {
    background: #121212 !important;
    background-image: none !important;
}

/* Conversation list */
[data-jr-theme="spotify"] .conversation-panel .bg-gradient-to-r,
[data-jr-theme="spotify"] .conversation-panel [class*="from-white"] {
    background: #181818 !important;
    background-image: none !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .conversation-panel .bg-orange-50,
[data-jr-theme="spotify"] .conversation-panel [class*="bg-orange-50"] {
    background: rgba(243, 152, 26, 0.12) !important;
    border-left-color: #f3981a !important;
}

[data-jr-theme="spotify"] .conversation-panel .border-gray-50,
[data-jr-theme="spotify"] .conversation-panel .border-b {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

[data-jr-theme="spotify"] .conversation-panel .text-gray-900 {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .conversation-panel .ring-white {
    --tw-ring-color: #181818 !important;
}

[data-jr-theme="spotify"] .chat-panel .flex-col.h-full.bg-white,
[data-jr-theme="spotify"] .chat-panel > .bg-white,
[data-jr-theme="spotify"] .chat-panel .border-b.bg-white {
    background: #181818 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

[data-jr-theme="spotify"] .chat-panel .bg-white.rounded-xl {
    background: #282828 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .chat-panel .hover\:bg-gray-100:hover,
[data-jr-theme="spotify"] .chat-panel .hover\:bg-gray-50:hover {
    background: #333333 !important;
}

[data-jr-theme="spotify"] .chat-panel .bg-gray-50,
[data-jr-theme="spotify"] .chat-panel .bg-gray-100 {
    background: #242424 !important;
}

[data-jr-theme="spotify"] .chat-panel input,
[data-jr-theme="spotify"] .chat-panel textarea {
    background: #282828 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-jr-theme="spotify"] .active {
    background: rgba(243, 152, 26, 0.12) !important;
}

/* ═══════════════════════════════════════════════════════════
   ANALYTICS (ins-*)
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] .ins-shell {
    background: transparent !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .ins-header-title,
[data-jr-theme="spotify"] .ins-stat-value,
[data-jr-theme="spotify"] .ins-section-title {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .ins-header-sub,
[data-jr-theme="spotify"] .ins-stat-label {
    color: #b3b3b3 !important;
}

[data-jr-theme="spotify"] .ins-back-link {
    color: #f3981a !important;
}

[data-jr-theme="spotify"] .ins-stat-card,
[data-jr-theme="spotify"] .ins-section,
[data-jr-theme="spotify"] .ins-compare {
    background: #181818 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .ins-shell select,
[data-jr-theme="spotify"] .ins-shell table,
[data-jr-theme="spotify"] .ins-shell th,
[data-jr-theme="spotify"] .ins-shell td {
    background: #282828 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════════════
   LISTING DETAIL, tags, save/share/report
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] .jr2-tag,
[data-jr-theme="spotify"] .jr2-mini-chip,
[data-jr-theme="spotify"] .jr2-distance {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .jr2-save-tools button,
[data-jr-theme="spotify"] .jr2-save-tools a {
    color: #ffffff !important;
    background: #282828 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-jr-theme="spotify"] .jr2-save-tools button:hover,
[data-jr-theme="spotify"] .jr2-save-tools a:hover {
    background: #333333 !important;
    border-color: rgba(243, 152, 26, 0.45) !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .jr2-save-tools button i,
[data-jr-theme="spotify"] .jr2-save-tools a i,
[data-jr-theme="spotify"] .jr2-save-tools button svg,
[data-jr-theme="spotify"] .jr2-save-tools a svg {
    color: #f3981a !important;
}

[data-jr-theme="spotify"] .jr2-spec-label {
    color: #1db954 !important;
}

[data-jr-theme="spotify"] .jr2-spec-value {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .jr2-phone-band,
[data-jr-theme="spotify"] .jr2-phone-band a {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .jr2-trust-box {
    color: #ffffff !important;
    background: rgba(29, 185, 84, 0.1) !important;
    border-color: rgba(29, 185, 84, 0.3) !important;
}

/* ═══════════════════════════════════════════════════════════
   POST AD, category chips
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] .pa-chip {
    background: #242424 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .pa-chip:hover {
    border-color: #f3981a !important;
    background: #282828 !important;
}

[data-jr-theme="spotify"] .pa-chip.active {
    background: rgba(243, 152, 26, 0.14) !important;
    border-color: #f3981a !important;
    box-shadow: 0 0 0 2px rgba(243, 152, 26, 0.2) !important;
}

[data-jr-theme="spotify"] .pa-chip-icon {
    background: rgba(243, 152, 26, 0.18) !important;
    color: #f3981a !important;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH, listing tabs (brand orange)
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] .af-listing-tab.active {
    background: #f3981a !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .af-listing-tabs {
    background: #242424 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-jr-theme="spotify"] .af-listing-tab {
    color: #b3b3b3 !important;
}

[data-jr-theme="spotify"] .af-listing-tab:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════ */
[data-jr-theme="spotify"] body.font-sans,
[data-jr-theme="spotify"] #root,
[data-jr-theme="spotify"] .admin_right {
    background-color: #121212 !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .admin_right .card,
[data-jr-theme="spotify"] .admin_right .bg-white,
[data-jr-theme="spotify"] .admin_right .panel,
[data-jr-theme="spotify"] .admin_right .content-wrapper,
[data-jr-theme="spotify"] .admin_right .main-content,
[data-jr-theme="spotify"] #example-collapse-sidebar,
[data-jr-theme="spotify"] .sidenav,
[data-jr-theme="spotify"] .sidebar {
    background-color: #181818 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .admin_right .text-gray-800,
[data-jr-theme="spotify"] .admin_right .text-gray-700,
[data-jr-theme="spotify"] .admin_right .text-gray-600,
[data-jr-theme="spotify"] .admin_right h1,
[data-jr-theme="spotify"] .admin_right h2,
[data-jr-theme="spotify"] .admin_right h3,
[data-jr-theme="spotify"] .admin_right h4,
[data-jr-theme="spotify"] .admin_right label {
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .admin_right .text-gray-500,
[data-jr-theme="spotify"] .admin_right .text-gray-400,
[data-jr-theme="spotify"] .admin_right small {
    color: #b3b3b3 !important;
}

[data-jr-theme="spotify"] .admin_right table thead,
[data-jr-theme="spotify"] .admin_right table tbody,
[data-jr-theme="spotify"] .admin_right table tr,
[data-jr-theme="spotify"] .admin_right table td,
[data-jr-theme="spotify"] .admin_right table th {
    background-color: #181818 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

[data-jr-theme="spotify"] .admin_right .hover\:bg-gray-50:hover,
[data-jr-theme="spotify"] .admin_right .hover\:bg-gray-100:hover {
    background-color: #282828 !important;
}

[data-jr-theme="spotify"] .admin_right .border-gray-200,
[data-jr-theme="spotify"] .admin_right .border-gray-300,
[data-jr-theme="spotify"] .admin_right .divide-y > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-jr-theme="spotify"] .admin_right .btn-light,
[data-jr-theme="spotify"] .admin_right .bg-light {
    background-color: #282828 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Kill white gradients globally in dark mode */
[data-jr-theme="spotify"] [class*="bg-gradient-to"],
[data-jr-theme="spotify"] [class*="from-white"],
[data-jr-theme="spotify"] [class*="from-gray-50"],
[data-jr-theme="spotify"] [class*="to-orange-50"] {
    background-image: none !important;
}

[data-jr-theme="spotify"] .bg-orange-50 {
    background-color: rgba(243, 152, 26, 0.12) !important;
}
