/* === WRAPPER === */

.tradingcard-carousel-wrapper {
  max-width: 750px;
  margin: 2rem auto;
  position: relative;
  overflow: visible;
  font-family: 'AbeeZee', 'Calibri', sans-serif;
  font-size: 18px;
  padding: 0 35px;
}

/* === CAROUSEL STRUCTURE === */

.carousel {
  width: 100%;
  overflow: visible;
  position: relative;
}

.carousel-inner {
  padding: 0 10px 2rem;
  overflow: hidden;
}

/* Override default Bootstrap behavior to keep cards centered when sliding */

.carousel-item {
  transition: transform .6s ease-in-out;
  justify-content: center;
  align-items: center;
}

.carousel-item.active, .carousel-item-next, .carousel-item-prev {
  display: flex;
}

/* === TRADING CARDS === */

.tradingcard {
  width: 100%;
  max-width: 600px;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 15px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  background: #f0f4f8;
  color: #222;
  overflow: hidden;
}

/* === BONDING BACKGROUNDS === */

.bonding-covalent {
  background: linear-gradient(145deg, #d8ecf8, #c6e2f9);
}

.bonding-ionic {
  background: linear-gradient(145deg, #ffe0d0, #ffd8b2);
}

.bonding-metallic {
  background: linear-gradient(145deg, #e6e6e6, #cccccc);
}

.bonding-giant {
  background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
}

.bonding-hybrid {
  background: linear-gradient(145deg, #e2e8f0, #dee2e6);
}

/* === CARD CONTENT === */

.tradingcard .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
}

.tradingcard .badges {
  font-size: 1.4rem;
}

.tradingcard .card-body {
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.85);
}

.tradingcard .formula {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}

.tradingcard .card-img {
  display: block;
  max-width: 120px;
  margin: 0.5rem auto;
}

.tradingcard ul.properties {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.tradingcard ul.properties li {
  margin-bottom: 0.4rem;
}

.tradingcard .ratings {
  margin-top: 1rem;
  line-height: 1.6;
}

.rating-note {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.2rem;
}

/* one place to choose the vertical anchor for the arrows */

#mainCarouselWrapper {
  position: relative;
  --ctrl-y: 320px;
}

@media (max-width: 992px) {
  #mainCarouselWrapper {
    --ctrl-y: 280px;
  }
}

@media (max-width: 576px) {
  #mainCarouselWrapper {
    --ctrl-y: 240px;
  }
}

/* === CAROUSEL CONTROLS === */

.carousel-control-prev, .carousel-control-next {
  position: absolute;
  z-index: 20;
  top: var(--ctrl-y);
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.carousel-control-prev {
  left: -35px;
}

.carousel-control-next {
  right: -35px;
}

/* === MOBILE ADJUSTMENTS === */

@media (max-width: 576px) {
  .tradingcard-carousel-wrapper {
    padding: 0 15px;
  }
}

@media (max-width: 576px) {
  .carousel-control-prev {
    left: -15px;
  }
}

@media (max-width: 576px) {
  .carousel-control-next {
    right: -15px;
  }
}

.carousel-control-prev-icon, .carousel-control-next-icon {
  background-size: 75% 75%;
}

/* === FILTER BUTTONS === */

.card-toggle-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.card-toggle-buttons .btn {
  flex: 1 1 auto;
  min-width: 120px;
  background: #ffd43b;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.card-toggle-buttons .btn.active {
  background: #0d6efd;
  color: white;
}

/* === CARD KEY === */

.card-key {
  width: 100%;
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
  font-size: 0.92rem;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  max-width: 1000px;
  margin: 0 auto 1rem;
}

.card-key h6 {
  margin-bottom: 0.3rem;
}

.key-toggle {
  font-weight: bold;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-block;
  list-style: none;
}

details.card-key[open] .key-toggle {
  margin-bottom: 0.5rem;
}

/* === LEGEND GRID === */

.legend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.4rem 1.2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.legend-box {
  width: 20px;
  height: 20px;
  display: inline-block;
  margin-right: 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
}

.legend-box.bonding-covalent {
  background: linear-gradient(145deg, #d8ecf8, #c6e2f9);
}

.legend-box.bonding-ionic {
  background: linear-gradient(145deg, #ffe0d0, #ffd8b2);
}

.legend-box.bonding-metallic {
  background: linear-gradient(145deg, #e6e6e6, #cccccc);
}

.bonding-none {
  background: linear-gradient(145deg, #f5f6fb, #e7e9f5);
}

.legend-box.bonding-giant {
  background: linear-gradient(145deg, #f5f5f5, #e0e0e0);
}

.legend-box.bonding-hybrid {
  background: linear-gradient(145deg, #e2e8f0, #dee2e6);
}

.card-key .legend-section:not(:last-child) {
  margin-bottom: 0.75rem;
}

