/* Custom property for gradient animation */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* Root variables */
:root {
  --bg-dark: #1a1a2e;
  --bg-body: #16213e;
  --clr-top1-1: #ffd700;
  --clr-top1-2: #ffca28;
  --clr-top1-3: #ffeb3b;
  --clr-top10-1: #b0bec5;
  --clr-top10-2: #eceff1;
  --clr-top10-3: #78909c;
  --clr-top25-1: #d7a017;
  --clr-top25-2: #f4ca64;
  --clr-top25-3: #a1887f;
  
  /* Animated gradient colors */
  --card-bg: #1a1a2e;
  --gradient-1: #2d1b69;
  --gradient-2: #11998e;
  --gradient-3: #38ef7d;
  --gradient-4: #4a90e2;
  --gradient-5: #7b68ee;
}

body {
  background: url('../img/bg1.png') no-repeat center center fixed;
  background-size: cover;
  color: #f8f8f8;
  font-family: Arial, sans-serif;
  text-align: center;
  padding-top: 200px;
}

h1 {
  margin-top: 20px;
}

.jacquard-24-regular {
  font-family: "Jacquard 24", system-ui;
  font-weight: 400;
  font-style: normal;
}

.dog-card {
  border: 1px solid #3b3b54;
  padding: 10px;
  margin: 10px auto;
  width: 300px;
  background: #232336;
  border-radius: 8px;
}

.dog-card img {
  height: auto;
  border-radius: 4px;
}

a {
  color: #ffdf57;
  text-decoration: none;
}

/* Consolidated .dog-img rule (removed duplicate) */
.dog-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.2s ease-in-out;
  position: relative;
  z-index: 1;
  cursor: pointer;
}

/* Market logos in table */
.market-logo {
  max-width: 33px;
  max-height: 33px;
  width: auto;
  height: auto;
}

/* Table background (removed redundant background-color assuming --bs-table-bg is used) */
table.table-dark {
  --bs-table-bg: rgba(0, 0, 0, 0.6);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  --bs-table-hover-bg: rgba(255, 255, 255, 0.1);
}

/* Ad slot styling */
.ad-slot {
  border: 2px solid #ffffff;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

.ad-banner {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin-left: auto;
  margin-right: auto;
}

.ad-square {
  width: 100%;
  max-width: 300px;
  height: 250px;
  margin-left: auto;
  margin-right: auto;
}

.rarity-badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 0.7em;
  font-weight: lighter;
  color: #fff;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.03em;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: help;
  min-width: 1em;
  min-height: 1em;
}

.rarity-badge:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* Tooltip styles (consolidated z-index to 1011) */
.rarity-badge.custom-tooltip {
  position: relative;
  z-index: 1010;
}

.rarity-badge .tooltip-text {
  position: absolute;
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  z-index: 1011 !important;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85em;
  font-weight: normal;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rarity-badge .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.rarity-badge.custom-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.rarity-top1 {
  background: linear-gradient(90deg, #ffd700 0%, #fffbe6 100%);
  color: #222;
  border: 2px solid #fffbe6;
}

.rarity-top5 {
  background: linear-gradient(90deg, #b0bec5 0%, #eceff1 100%);
  color: #222;
  border: 2px solid #eceff1;
}

.rarity-top10 {
  background: linear-gradient(90deg, #cd7f32 0%, #f4ca64 100%);
  color: #222;
  border: 2px solid #f4ca64;
}

.rarity-top25 {
  background: linear-gradient(90deg, #b3ecff 0%, #43e9ff 40%, #38f9d7 80%, #e0f7fa 100%);
  color: #222;
  border: 2px solid #43e9ff;
}

.rarity-top50 {
  background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
}

.rarity-rest {
  background: #343a40;
}

.rarity-unknown {
  background: #888;
}

.disabled-field {
  opacity: 0.5;
  filter: grayscale(60%);
  pointer-events: none;
}

/* Highlight styles (consolidated hover scaling) */
.highlight {
  width: 50px;
  height: 50px;
  background: var(--bg-dark);
  border-radius: 50%;
  position: relative;
  z-index: 10;
  transition: transform 0.2s ease-in-out;
}

/* Unified hover scaling for .highlight and .dog-img */
tr:hover .highlight,
.highlight:hover {
  transform: scale(2.25);
  z-index: 20;
  max-width: 120px;
  max-height: 120px;
}

tr:hover .dog-img,
.highlight:hover .dog-img {
  width: 100%;
  height: 100%;
}

/* Highlight pseudo-elements */
.highlight-top1percent::before,
.highlight-top1percent::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  z-index: -1;
  background: conic-gradient(
      from var(--gradient-angle),
      #fffbe6, #ffd700, #fff8b0, #fff, #ffe066, #ffd700
  );
  border-radius: 50%;
  animation: rotation 2s linear infinite;
}

.highlight-top5percent::before,
.highlight-top5percent::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  z-index: -1;
  background: conic-gradient(
      from var(--gradient-angle),
      #eceff1, #b0bec5, #c0c0c0, #eceff1, #78909c, #eceff1
  );
  border-radius: 50%;
  animation: rotation 2s linear infinite;
}

.highlight-top10percent::before,
.highlight-top10percent::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  z-index: -1;
  background: conic-gradient(
      from var(--gradient-angle),
      #f4ca64, #cd7f32, #a1887f, #f4ca64, #cd7f32, #f4ca64
  );
  border-radius: 50%;
  animation: rotation 2s linear infinite;
}

.highlight-top25percent::before,
.highlight-top25percent::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  z-index: -1;
  background: conic-gradient(
      from var(--gradient-angle),
      #b3ecff, #43e9ff, #38f9d7, #e0f7fa, #b3ecff, #43e9ff
  );
  border-radius: 50%;
  animation: rotation 2s linear infinite;
}

.highlight-top1percent::after,
.highlight-top5percent::after,
.highlight-top10percent::after,
.highlight-top25percent::after {
  filter: blur(1.5rem);
  opacity: 0.8;
}

@keyframes rotation {
  0% { --gradient-angle: 0deg; }
  100% { --gradient-angle: 360deg; }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow: visible !important;
}

.table {
  width: 100%;
  min-width: 900px;
}

.dm-mono-light {
  font-family: "DM Mono", monospace;
  font-weight: 300;
  font-style: normal;
}

.dm-mono-regular {
  font-family: "DM Mono", monospace;
  font-weight: 400;
  font-style: normal;
}

.stats-container {
  background: rgba(20, 20, 40, 0.65);
  border-radius: 16px;
  padding: 1.5rem 2.5rem 1rem 2.5rem;
  margin: 0 auto 1.5rem auto;
  display: inline-block;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  max-width: 90vw;
}

.stats-container h2,
.stats-container span {
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.doge-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.15em;
}

/* Grid View Styles */
.grid-view {
  display: none;
}

.grid-view.active {
  display: block;
}

.dog-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
}

@media (max-width: 1400px) {
  .dog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .dog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .dog-grid {
    grid-template-columns: 1fr;
  }
}

.dog-card {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  z-index: 1;
  cursor: pointer;
}

.dog-card::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  background: conic-gradient(
    from var(--gradient-angle),
    var(--gradient-1),
    var(--gradient-2),
    var(--gradient-3),
    var(--gradient-4),
    var(--gradient-5),
    var(--gradient-1)
  );
  border-radius: inherit;
  animation: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dog-card::after {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -2;
  background: conic-gradient(
    from var(--gradient-angle),
    var(--gradient-1),
    var(--gradient-2),
    var(--gradient-3),
    var(--gradient-4),
    var(--gradient-5),
    var(--gradient-1)
  );
  border-radius: inherit;
  animation: rotation 8s linear infinite;
  filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dog-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(74, 144, 226, 0.3),
    0 0 60px rgba(74, 144, 226, 0.1);
  animation: cardPulse 2s ease-in-out infinite;
}

.dog-card:hover::before {
  opacity: 0.8;
  animation: rotation 2s linear infinite;
  filter: brightness(1.2) saturate(1.3);
}

.dog-card:hover::after {
  opacity: 0.5;
  animation: rotation 3s linear infinite reverse;
  filter: blur(8px) brightness(1.1);
}

.dog-card.rarity-top1 {
  border: 2px solid #ffd700;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a2a1e 100%);
}

.dog-card.rarity-top1:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 215, 0, 0.4),
    0 0 60px rgba(255, 215, 0, 0.2);
}

.dog-card.rarity-top5 {
  border: 2px solid #c0c0c0;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a2a2e 100%);
}

.dog-card.rarity-top5:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(192, 192, 192, 0.4),
    0 0 60px rgba(192, 192, 192, 0.2);
}

.dog-card.rarity-top10 {
  border: 2px solid #cd7f32;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a1e1e 100%);
}

.dog-card.rarity-top10:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(205, 127, 50, 0.4),
    0 0 60px rgba(205, 127, 50, 0.2);
}

.dog-card.rarity-top25 {
  border: 2px solid #87ceeb;
  background: linear-gradient(135deg, #1a1a2e 0%, #1e2a2e 100%);
}

.dog-card.rarity-top25:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(135, 206, 235, 0.4),
    0 0 60px rgba(135, 206, 235, 0.2);
}

.dog-card-image {
  position: relative;
  text-align: center;
  margin-bottom: 1rem;
}

.dog-card-image img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}

.dog-card:hover .dog-card-image img {
  transform: scale(1.1) rotate(2deg);
  filter: brightness(1.1) contrast(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Ensure text remains readable during hover */
.dog-card:hover .dog-card-title,
.dog-card:hover .dog-card-details {
  text-shadow: 
    -2px -2px 0 #000,
    -1px -2px 0 #000,
     0px -2px 0 #000,
     1px -2px 0 #000,
     2px -2px 0 #000,
    -2px -1px 0 #000,
    -1px -1px 0 #000,
     0px -1px 0 #000,
     1px -1px 0 #000,
     2px -1px 0 #000,
    -2px  0px 0 #000,
    -1px  0px 0 #000,
     1px  0px 0 #000,
     2px  0px 0 #000,
    -2px  1px 0 #000,
    -1px  1px 0 #000,
     0px  1px 0 #000,
     1px  1px 0 #000,
     2px  1px 0 #000,
    -2px  2px 0 #000,
    -1px  2px 0 #000,
     0px  2px 0 #000,
     1px  2px 0 #000,
     2px  2px 0 #000;
  z-index: 10;
  position: relative;
}

/* Price container should not get heavy text shadows */
.dog-card:hover .dog-card-price {
  z-index: 10;
  position: relative;
}

/* Adaptive background support - ensure smooth transitions */
.dog-card {
  transition: all 0.3s ease, background 0.5s ease;
  position: relative;
  z-index: 1;
}

/* Text readability enhancements for adaptive backgrounds */
.dog-card-title,
.dog-card-details {
  text-shadow: 
    -2px -2px 0 #000,
    -1px -2px 0 #000,
     0px -2px 0 #000,
     1px -2px 0 #000,
     2px -2px 0 #000,
    -2px -1px 0 #000,
    -1px -1px 0 #000,
     0px -1px 0 #000,
     1px -1px 0 #000,
     2px -1px 0 #000,
    -2px  0px 0 #000,
    -1px  0px 0 #000,
     1px  0px 0 #000,
     2px  0px 0 #000,
    -2px  1px 0 #000,
    -1px  1px 0 #000,
     0px  1px 0 #000,
     1px  1px 0 #000,
     2px  1px 0 #000,
    -2px  2px 0 #000,
    -1px  2px 0 #000,
     0px  2px 0 #000,
     1px  2px 0 #000,
     2px  2px 0 #000;
  position: relative;
  z-index: 5;
}

/* Enhanced price section for better contrast */
.dog-card-price {
  position: relative;
  z-index: 5;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.dog-card-title {
  font-size: 3.3rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 0.5rem;
  /* Use the Jacquard 24 font class */
  font-family: "Jacquard 24", system-ui;
  font-weight: 400;
  font-style: normal;
  /* Ensure text is visible even if font fails to load */
  display: block;
  min-height: 1.5rem;
  line-height: 0.6;
}

.dog-card-details {
  font-size: 0.85rem;
  color: #ccc;
}

.dog-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.dog-card-label {
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  display: inline-block;
  margin-right: 0.5rem;
}

.dog-card-value {
  color: #fff;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  display: inline-block;
}

.dog-card-price {
  background: #ffffff;
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.dog-card:hover .dog-card-price {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.dog-card-price .price-main {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1b5e20;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dog-card-price .price-usd {
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}

.dog-card-badges {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.dog-card-badges img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Fix market icon clickability */
.dog-card-market {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  pointer-events: auto;
}
.dog-card-market a, .dog-card-market img {
  pointer-events: auto;
  cursor: pointer;
}
.dog-card::before,
.dog-card::after {
  pointer-events: none;
}

.dog-card-market img {
  width: 30px;
  height: 30px;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.dog-card:hover .dog-card-market img {
  opacity: 1;
  transform: scale(1.1);
}

.dog-card-rarity {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 102;
}

/* Grid view rarity badges - centered beneath image */
.dog-card .rarity-badge {
  display: block;
  text-align: center;
  margin: 0.5rem auto 0;
  max-width: fit-content;
}

/* List View Styles */
.list-view.active {
  display: block;
}

.list-view {
  display: none;
}

/* Keyframes for gradient animation */
@keyframes rotation {
  0% {
    --gradient-angle: 0deg;
  }
  100% {
    --gradient-angle: 360deg;
  }
}

@keyframes cardPulse {
  0%, 100% {
    transform: translateY(-8px) scale(1.02);
  }
  50% {
    transform: translateY(-12px) scale(1.03);
  }
}

/* Pagination Styles */
.pagination .page-link {
  background-color: #2c2c54;
  border-color: #3b3b54;
  color: #f8f8f8;
}

.pagination .page-link:hover {
  background-color: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}

.pagination .page-item.active .page-link {
  background-color: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  background-color: #1a1a2e;
  border-color: #3b3b54;
  color: #6c757d;
}

/* Magic Wand Loading Cursor - Using JavaScript cursor element instead of CSS */
.loading-cursor {
  /* Cursor handled by JavaScript magicWandCursor element */
}

/* Loading spinner overlay for the wand */
.magic-wand-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: none;
}

.magic-wand-spinner.active {
  opacity: 1;
  display: block;
}

.magic-wand-spinner img {
  width: 32px;
  height: 32px;
  animation: wandSpin 1.5s ease-in-out infinite, wandPulse 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.6));
}

/* Wand animations */
@keyframes wandSpin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes wandPulse {
  0% { 
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.6)) brightness(1); 
  }
  100% { 
    filter: drop-shadow(0 0 20px rgba(74, 144, 226, 1)) brightness(1.2); 
  }
}

/* Loading states for images */
img[data-loading="true"] {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

/* Page transition loading - Using JavaScript cursor element instead of CSS */
body.page-loading {
  /* Cursor handled by JavaScript magicWandCursor element */
  position: relative;
}

/* Dimming overlay for loading state */
body.page-loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  pointer-events: none;
}

/* Magic wand cursor animation */
body.loading-cursor {
  cursor: url("/static/img/magicwand.png") 16 16, auto !important;
}

/* Add spinning animation to the cursor */
@keyframes cursorSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body.loading-cursor {
  cursor: url("/static/img/magicwand.png") 16 16, auto !important;
}

/* Global Visitor Counter - Fixed Position */
.visitor-counter-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  pointer-events: none;
}
.visitor-counter-fixed > div {
  pointer-events: auto;
}

/* Responsive Dog Grid - eliminates horizontal scroll */
.dog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .dog-grid {
    max-width: 1100px;
  }
}

@media (max-width: 900px) {
  .dog-grid {
    max-width: 700px;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .dog-grid {
    max-width: 98vw;
    gap: 0.75rem;
  }
}

@media (max-width: 576px) {
  .dog-grid {
    max-width: 100vw;
    padding: 0.5rem 0;
    gap: 0.5rem;
  }
}

/* Ensure NFT image is always pure and above overlays */
.dog-card-image {
  position: relative;
  z-index: 100;
}
.dog-card-image img {
  position: relative;
  z-index: 101;
  background: none !important;
  box-shadow: none !important;
}
/* Force all overlays and gradients to stay behind the image */
.dog-card::before,
.dog-card::after {
  pointer-events: none;
  z-index: 1;
}
/* Ensure card background gradients don't interfere with images */
.dog-card {
  position: relative;
  z-index: 1;
}

/* Thicker outer border for dog cards */
.dog-card {
  border: 4px solid #3b3b54;
}
.dog-card.rarity-top1 {
  border-width: 5px;
}
.dog-card.rarity-top5 {
  border-width: 5px;
}
.dog-card.rarity-top10 {
  border-width: 5px;
}
.dog-card.rarity-top25 {
  border-width: 5px;
}

/* --- Z-INDEX FIX: DOG IMAGES ALWAYS ON TOP --- */
.dog-img,
.dog-card-image img,
.dog-image,
.dog-thumb {
  position: relative !important;
  z-index: 99999 !important;
  /* Ensure no overlays can affect the image */
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
}

/* CRITICAL: Disable all pseudo-elements that could cover images */
.dog-card::before,
.dog-card::after {
  display: none !important;
  z-index: -9999 !important;
}

/* Restore highlight effects but ensure they don't cover the actual dog image */
.highlight::before,
.highlight::after {
  z-index: -1 !important;
  pointer-events: none !important;
}

/* Ensure the highlight container doesn't interfere with the image */
.highlight {
  position: relative;
  z-index: 1;
}

/* CRITICAL: Disable any potential overlays on image containers */
.dog-card-image,
.dog-card-image *,
.highlight * {
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Ensure adaptive backgrounds work properly */
.dog-card {
  position: relative;
  z-index: 1;
  transition: background 0.5s ease;
}

/* CRITICAL: Force all dog images to be completely unobstructed */
.dog-img,
.dog-card-image img,
.dog-image,
.dog-thumb {
  /* Remove any potential dimming effects */
  mix-blend-mode: normal !important;
  isolation: isolate !important;
  /* Ensure maximum visibility */
  opacity: 1 !important;
  visibility: visible !important;
  /* Prevent any background interference */
  background: transparent !important;
}

/* PFP Style Toggle Styling */
.pfp-toggle-container {
  background: rgba(20, 20, 40, 0.65);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.pfp-toggle-container .form-check-input {
  background-color: #2c2c54;
  border-color: #4a90e2;
  width: 1.2em;
  height: 1.2em;
}

.pfp-toggle-container .form-check-input:checked {
  background-color: #4a90e2;
  border-color: #4a90e2;
}

.pfp-toggle-container .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(74, 144, 226, 0.25);
}

.pfp-toggle-container .form-check-label {
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

/* Dynamic Image Styling */
/* Default: X Style PFPs (Round) */
.dog-img,
.dog-card-image img,
.dog-image,
.dog-thumb {
  border-radius: 50%;
  object-fit: cover;
  transition: all 0.3s ease;
}

/* When PFP style is disabled: Original aspect ratio */
.pfp-style-disabled .dog-img,
.pfp-style-disabled .dog-card-image img,
.pfp-style-disabled .dog-image,
.pfp-style-disabled .dog-thumb {
  border-radius: 0;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.1);
}

/* Grid view specific adjustments */
.pfp-style-disabled .dog-card-image img {
  width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: 0;
}

/* List view specific adjustments */
.pfp-style-disabled .dog-img {
  width: 80px;
  height: 80px;
  border-radius: 0;
  object-fit: contain;
}

/* Highlight container adjustments for non-PFP mode */
.pfp-style-disabled .highlight {
  border-radius: 0;
  overflow: visible;
  width: 80px;
  height: 80px;
  background: transparent;
}

.pfp-style-disabled .highlight::before,
.pfp-style-disabled .highlight::after {
  border-radius: 0;
}

/* Ensure dog number appears above image when PFP style is disabled */
.pfp-style-disabled .dog-card-rarity {
  z-index: 103;
}