.modal-backdrop.show {
  background-color: rgba(0, 0, 0, 0.1); /* black instead of white */
    backdrop-filter: blur(100px) saturate(200%) contrast(200%);
  -webkit-backdrop-filter: blur(20px) saturate(180%) contrast(120%);
}

/* Override Bootstrap modal for dark theme */
.dark-modal .modal-content {
  background-color: rgba(30, 30, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.05);
}

.dark-modal img {
  border-radius: 0.75rem;
}


@media (min-width: 768px) {
  .custom-modal-width {
    max-width: 90vw;
  }
}


img.card_image.enlarged {
  position: fixed;
  left: 50%;
  top: 50%;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

img.card_image.enlarged::before,
img.card_image.enlarged::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

img.card_image.enlarged::before {
  background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 80%);
  transition: background-position 0.1s ease;
}

img.card_image.enlarged::after {
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 70%);
  opacity: 0.2;
  transition: background-position 0.1s ease, opacity 0.2s ease;
}
.card_tilt {
  display: block;
  margin: 0 auto;
  max-width: 90vw;
  max-height: 90vh;
  transition: transform 0.1s ease;
  transform-style: preserve-3d;
  will-change: transform;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

@media (min-width: 768px) {
  #modal_size.imgonly_card_modal {
      max-width: 50%;
  }
  #modal_size.small_card_modal {
      max-width: 50%;
  }
  #modal_size.medium_card_modal {
      max-width: 60%;
  }
  #modal_size.large_card_modal {
      max-width: 90%;
  }
}

@media (max-width: 767px) {
  .dark-modal .modal-content {
    margin: 1rem;
    padding: 1rem;
    border-radius: 12px;
  }
}

#card_modal_table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  border: 2px solid #ccc;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

#card_modal_table .card_modal_table_header {
  background-color: #323232;
}

.iLwuzm {
  position:relative;
    z-index: -1;
    margin-top: -24px;
    height: 250px;
    width: 99%;
    background: url("https://assets.pkmn.gg/fit-in/300x418/filters:format(webp)/images/cards/A1/A1-001.png?signature=654346a289b85cea8dade1b6bea65f526ea46cd73b599916e408d96da1bddecf") center 30% / cover content-box;
    border-radius: 1rem;
    padding: 1px;
}
.dsSeiM {
    width: 100%;
    z-index: -1;
    margin-top: -24px;
    height: 250px;
}

.gZtXjb {
    background: linear-gradient(rgba(31, 35, 45, 0.8) 0%, rgb(31, 35, 45) 100%);
    height: 300px;
    min-width: 100%;
    position: absolute;
    z-index: -5;
    align-self: center;
    backdrop-filter: blur(10px);
}
.modal-dialog-centered{
    justify-content: center;

}

.card-modal {
    font-family: sans-serif;
    margin: auto;
}

#cardDetailsModal > .card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.card-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.card-section h5 {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
}

.attack, .ability {
    margin-bottom: 10px;
}

details summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 4px;
}

details p {
    margin: 0 0 8px 0;
}

.element-icon {
    height: 1em;
    width: 1em;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 3px;
}

#userSettingsForm {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.modal-content {
  max-height: 90vh; /* 90% of viewport height */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-body {
  margin-top: 1rem;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

#cardModalImage{
    height: 100%;
    margin: auto;
    padding-top: 25px;
}
#modalCardImage {
    width: 100%;
}

.modal-content {
  position: relative;
}

.modal-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(30, 30, 46, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  padding-bottom: 15px;
  width: 60px;
  height: 60px;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.modal-nav-button:hover {
  background-color: rgba(255, 255, 255, 0.25);
}


@media (max-width: 767px) {
  .left-nav {
    left: -10px; /* adjust to hug modal edge */
  }

  .right-nav {
    right: -10px;
  }
}

@media (min-width: 767px) {
  .left-nav {
    left: -30px; /* adjust to hug modal edge */
  }

  .right-nav {
    right: -30px;
  }
}
.modal.show {
  overflow: visible;
  pointer-events: auto;
}

.modal-dialog {
  overflow: visible !important;
  pointer-events: auto;
  position: relative;
  max-height: 100vh;
  pointer-events: none; /* Allow clicks through */
  max-width: 100%;
  margin: 0 auto;
}

.modal-content {
  overflow: visible;
}
.modal-nav-button {
  z-index: 1060; /* must be higher than modal (1055) and backdrop (1050) */
  pointer-events: auto;
}
#prevButton:disabled,
#nextButton:disabled {
  display: none;
}
.btn-close {
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  border-radius: 50px;
  z-index: 500;
}

@media (min-width: 767px) {
  .athird {
    width: 33.333333%; /* adjust to hug modal edge */
  }
}
