#primary-card-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  display: none; /* Hidden by default flex*/
  flex-direction: column;
  z-index: 1000;
  overflow: hidden; /* Keep this to prevent double scrollbars */
}

#primary-card-page .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: red;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
}

#primary-card-page .page-body {
  height: 100vh; /* Change from 95vh to 100vh */
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  padding: 20px;
  overflow-y: auto; /* Add vertical scrolling */
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

#primary-card {
  height: auto;
  min-height: 400px;
  width: 90%;
  display: flex;
  flex-direction: row;
  align-items: flex-start; /* Change from center to flex-start for better alignment */
  gap: 30px;
  padding: 40px;
  color: white;
  flex-shrink: 0; /* Prevent card from shrinking */
}

/* Image container with relative positioning for overlays */
.image-container {
  position: relative;
  display: inline-block;
  padding-top: 50px;
}

#primary-card img {
  width: 336px;
  height: 470px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

/* Hover effects for the main image */
#primary-card img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
  border-color: gold;
  cursor: pointer;
}

/* Rarity overlay - bottom left */
.rarity-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
}

.rarity-icon {
  width: 40px;
  height: 40px;
  transition: all 0.3s ease;
}

.rarity-icon:hover {
  transform: scale(1.2);
}

/* Affection emoji overlay - top right */
.affection-overlay {
  position: absolute;
  top: 55px;
  right: 10px;
  z-index: 2;
}

.affection-emoji {
  font-size: 30px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  display: block;
  cursor: pointer;
}

/* Different affection states */
.affection-emoji.low {
  filter: grayscale(0.8) brightness(0.7);
}
.affection-emoji.medium {
  filter: brightness(1.1);
}
.affection-emoji.high {
  filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.6));
  animation: pulse 3s infinite;
}

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

#primary-card .card-details {
  text-align: left;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-header {
  border-bottom: 2px solid gold;
  padding-bottom: 10px;
}

.card-name {
  margin: 0;
  font-size: 1.8em;
  color: gold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.card-rarity {
  color: #ffd700;
  font-weight: bold;
  font-size: 0.9em;
  margin-top: 5px;
}

.card-description h3 {
  margin: 0 0 8px 0;
  color: #ccc;
  font-size: 1.1em;
}

.card-description p {
  margin: 0;
  color: #aaa;
  line-height: 1.4;
}

.card-stats {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.stat-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.stat-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
  font-size: 0.8em;
  color: #ccc;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.1em;
  font-weight: bold;
  color: #fff;
}

.attack-info {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.attack-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.attack-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 8px;
}

.attack-label {
  font-size: 0.9em;
  color: gold;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.attack-name {
  font-size: 1em;
  font-weight: bold;
  color: white;
  text-align: center;
}

.attack-type {
  font-size: 0.8em;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  text-transform: capitalize;
}

/* Attack type colors */
.attack-type.melee {
  background: linear-gradient(135deg, #ff6b6b, #c44569);
  color: white;
}

.attack-type.defense {
  background: linear-gradient(135deg, #4ecdc4, #00b894);
  color: white;
}

.attack-type.rage {
  background: linear-gradient(135deg, #ff9ff3, #f368e0);
  color: white;
}

.attack-type.weaken {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: white;
}

.attack-type.lethal {
  background: linear-gradient(135deg, #fd79a8, #e84393);
  color: white;
}

.attack-type.poison {
  background: linear-gradient(135deg, #00cec9, #00a8ff);
  color: white;
}

.attack-type.magic {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #2d3436;
}

.attack-type.ranged {
  background: linear-gradient(135deg, #81ecec, #00cec9);
  color: #2d3436;
}

/* For multiple types */
.multiple-types {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.multiple-type {
  font-size: 0.7em;
  padding: 3px 8px;
  border-radius: 15px;
  font-weight: bold;
}

.total-power {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 215, 0, 0.2);
  padding: 12px 20px;
  border-radius: 8px;
  border: 2px solid gold;
  margin-top: 10px;
}

.total-label {
  font-size: 1.1em;
  color: gold;
  font-weight: bold;
}

.total-value {
  font-size: 1.4em;
  color: gold;
  font-weight: bold;
}

.slider-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 90%;
  gap: 10px;
  margin-top: 20px; /* Add some space above the slider */
  flex-shrink: 0; /* Prevent slider from shrinking */
}

.slider-container::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, gold, transparent);
  opacity: 0.6;
}

.cards-slider {
  margin-top: 0;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 15px;
  padding: 20px;
  width: 100%;
  height: 180px;
  min-height: 180px;
  align-items: center;
  scroll-behavior: smooth; /* Smooth scrolling */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
}

/* Hide scrollbar for Chrome/Safari */
.cards-slider::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 24px;
  font-weight: bold;
  width: 40px;
  height: 60px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.scroll-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: gold;
  color: gold;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.scroll-btn:active {
  transform: scale(0.95);
}

/* Optional: Hide buttons when not needed */
.scroll-btn.hidden {
  opacity: 0.3;
  cursor: not-allowed;
}

.scroll-btn.hidden:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: none;
  box-shadow: none;
}

#card-slider img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#card-slider img:hover {
  transform: perspective(1000px) rotateY(5deg) rotateX(5deg) scale(1.1);
  border-color: #9b59b6;
  box-shadow: 0 15px 35px rgba(155, 89, 182, 0.4), 0 5px 15px rgba(0, 0, 0, 0.3);
}
