/* xmrbazaar-inspired dark theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root{
  --bg:#1a1f1e;
  --panel:#1f2524;
  --card:#1c2120;
  --muted:#98a3a2;
  --muted-2: rgba(255,255,255,0.06);
  --text:#e6f0ef;
  --accent:#e87722;
  --accent-2:#d66a1a;
  --border: rgba(255,255,255,0.04);
}

/* ============================================
   BASE STYLES
   ============================================ */
body{
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background:var(--bg);
  color:var(--text);
  padding-top:72px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar{
  height:72px;
  background:linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.35));
  border-bottom:1px solid rgba(255,255,255,0.02);
}

.navbar .navbar-brand{
  font-weight:700;
  letter-spacing:0.4px;
  color:var(--text) !important;
}

/* ============================================
   CARDS & LAYOUT
   ============================================ */
.card{
  background: linear-gradient(180deg, var(--card), #08100f);
  border:1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border-radius:8px;
}

.card .card-body{
  color:var(--text);
}

.market-layout{
  display:flex;
  gap:24px;
  align-items:flex-start;
}

.market-sidebar{
  width:280px;
  flex-shrink:0;
  padding:12px;
}

.market-main{
  flex:1;
}

/* ============================================
   LISTING CARDS
   ============================================ */
.listing-card{
  display:block;
  overflow:hidden;
  border-radius:8px;
}

.listing-card .thumb{
  width:100%;
  height:220px;
  object-fit:cover;
  display:block;
}

.listing-card .card-body{
  padding:12px 14px;
}

.listing-title{
  font-size:1.05rem;
  font-weight:600;
  margin:0 0 6px 0;
}

.listing-desc{
  color:var(--muted);
  font-size:0.92rem;
  margin-bottom:8px;
}

.listing-card.sold{
  opacity: 0.75;
  filter: grayscale(0.3);
}

/* ============================================
   BADGES & PILLS
   ============================================ */
.price-badge{
  float:right;
  background:linear-gradient(180deg,var(--accent),var(--accent-2));
  color:#06221b;
  padding:8px 10px;
  border-radius:20px;
  font-weight:700;
}

.price-badge .price-btc,
.price-badge .price-eur{
  display:block;
  line-height:1.1;
}

.price-badge .price-eur{
  font-size:0.85em;
  margin-top:2px;
}

.category-pill,
.user-pill{
  display:inline-block;
  font-size:0.8rem;
  color:rgba(255,255,255,0.9);
  background:rgba(255,255,255,0.10);
  border:1px solid rgba(255,255,255,0.18);
  padding:2px 8px;
  border-radius:999px;
  letter-spacing:0.2px;
}

.seller-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace;
  font-size:0.82rem;
  color:var(--muted);
  background:rgba(255,255,255,0.02);
  padding:4px 6px;
  border-radius:4px;
}

.sold-badge{
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  animation: pulse 2s infinite;
}

.sold-badge-small{
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
}

@keyframes pulse{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.05); }
  100%{ transform: scale(1); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary{
  background: linear-gradient(180deg, #0bb389, #0aa07a);
  border:none;
}

.btn-outline-light{
  border:1px solid rgba(255,255,255,0.06);
}

.search-btn,
.contact-actions .btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #06221b;
}

.search-btn:hover,
.contact-actions .btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.4);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

/* ============================================
   CHAT
   ============================================ */
.chat-bubble{
  max-width:72%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.14);
}

.chat-bubble.other{
  background: #121a19;
}

.chat-bubble.mine{
  background: linear-gradient(180deg, #234b7a, #1b3960);
  color:#eef6ff;
  border-color: rgba(255,255,255,0.22);
}

.chat-meta{
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
}

.chat-body{
  margin-top:4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ============================================
   LIST GROUPS
   ============================================ */
.list-group-item{
  background-color: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.list-group-item-action:hover{
  background-color: rgba(232, 119, 34, 0.05);
  color: var(--text);
}

.list-group-item-action:focus{
  background-color: rgba(232, 119, 34, 0.08);
  color: var(--text);
}

.list-group-item .text-truncate{
  color: var(--muted);
}

/* ============================================
   PAGINATION & TABLES
   ============================================ */
.pagination .page-link{
  background:transparent;
  color:var(--text);
  border:1px solid rgba(255,255,255,0.03);
}

.table-dark{
  color:var(--text);
}

/* ============================================
   LISTING PAGE
   ============================================ */
.listing-price-main{
  text-align: right;
}

.price-btc-large{
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.price-eur-large{
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.2;
}

.listing-image-container{
  text-align: center;
  border-radius: 8px;
  overflow: visible;
  background: var(--muted-2);
}

.main-image-display{
  border-radius: 8px;
  overflow: hidden;
  background: var(--muted-2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.listing-image{
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 400px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.image-thumbnails{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 0;
}

.thumbnail{
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.thumbnail:hover{
  opacity: 1;
  border-color: var(--accent);
  transform: scale(1.05);
}

.thumbnail.active{
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(22, 199, 154, 0.5);
}

.listing-description{
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.description-content{
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
}

.listing-details{
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.details-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.detail-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
}

.detail-label{
  color: var(--muted);
  font-weight: 500;
}

.detail-value{
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   SELLER CARD
   ============================================ */
.seller-card{
  top: 20px;
}

.seller-info{
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem !important;
}

.avatar-circle{
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06221b;
  font-weight: 700;
  font-size: 1.2rem;
}

.avatar-circle-img{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.seller-username{
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.seller-stats{
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.stat-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-item:last-child{
  border-bottom: none;
}

.stat-label{
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value{
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb{
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.breadcrumb-item a{
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-item a:hover{
  color: var(--accent-2);
}

.breadcrumb-item.active{
  color: var(--muted);
}

.breadcrumb-item + .breadcrumb-item::before{
  color: var(--muted);
}

/* ============================================
   FOOTER
   ============================================ */
.footer{
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.footer-badge,
.privacy-badge{
  display: inline-block;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #000;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
}

.footer-badge:hover,
.privacy-badge:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.4);
  color: #000;
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section{
  padding: 2rem 0 1rem 0;
}

.search-input{
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

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

.search-input:focus{
  background-color: var(--panel);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 0.25rem rgba(232, 119, 34, 0.15);
  outline: none;
}

/* ============================================
   CATEGORY GRID
   ============================================ */
.category-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.category-card{
  background: linear-gradient(180deg, var(--card), #08100f);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.category-card:hover{
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(232, 119, 34, 0.08), rgba(232, 119, 34, 0.05));
  transform: translateY(-2px);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.2);
}

.category-card.active{
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(232, 119, 34, 0.12), rgba(232, 119, 34, 0.08));
  box-shadow: 0 4px 12px rgba(232, 119, 34, 0.3);
}

.category-card i{
  font-size: 1.5rem;
  color: var(--accent);
}

.category-card span:first-of-type{
  font-weight: 500;
  text-align: center;
}

.category-count{
  font-size: 0.875rem;
  color: #8e9c9a;
  background-color: rgba(142, 156, 154, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.clamp-2{
  display:-webkit-box;
  line-clamp:2;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.text-light-muted{
  color: rgba(255,255,255,0.75) !important;
}

.text-medium-muted{
  color: rgba(255,255,255,0.65) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width:991px){
  .market-layout{
    flex-direction:column;
  }
  
  .market-sidebar{
    width:100%;
  }
  
  .listing-card .thumb{
    height:180px;
  }
  
  .seller-card{
    position: relative !important;
    top: 0 !important;
  }
  
  .listing-price-main{
    text-align: left;
    margin-top: 1rem;
  }
}

@media (max-width:768px){
  .category-grid{
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width:576px){
  .listing-card .thumb{
    height:140px;
  }
}