@import url("./main.css");

.main {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  justify-content: center;
  margin-bottom: 50px;
}

.main img {
  width: 40%;
  transition: all 0.3s linear;
}
.main img:hover {
  transform: scale(1.05);
}
.main h3 {
  margin: 20px;
  font-size: 2.2rem;
}
.main p,
.tarot-reading p {
  padding: 0 50px;
  font-size: 1.05rem;
}

.t-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 30px;
}
.t-detail {
  font-size: 1rem;
  font-family: "seesai", "Fricolage Grotesque", sans-serif;
  text-align: center;
  margin-bottom: 30px;
}
/* Grid layout */
.card-grid {
  display: grid;
  padding: 0px 30px;
  grid-template-columns: repeat(6, 1fr);
  gap: 60px;
}
.card {
  padding: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(241, 221, 248, 0.37);
  box-shadow: 0 0 10px rgba(241, 221, 248, 0.6), 0 0 20px rgba(241, 221, 248, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}
.card:hover {
  transform: scale(1.05);
}
.card img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}
.card span {
  display: block;
  color: var(--white);
  font-weight: bold;
  margin-top: 5px;
}
/* Toggle button */
.toggle-btn {
  display: none;
  margin: 20px auto;
  text-align: center;
  color: var(--light-lavender);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.7rem;
  transition: all 0.5s;
}
.toggle-btn:hover {
  color: var(--medium-purple);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}
/* Popup box */
.popup {
  background: var(--dark-purple);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  padding: 20px 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
/* Left column (image) */
.popup img {
  padding: 20px;
  max-width: 200px;
  min-width: 160px;
  border-radius: 8px;
  flex: 1;
}
/* Right column (text) */
.popup-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.popup-content h2 {
  font-size: 1.8rem;
  margin: 0 0 10px;
}

.popup-content p {
  font-family: "seesai", "Fricolage Grotesque", sans-serif;
  font-size: 1rem;
  color: #ccc;
  line-height: 1.4em;
}
/* Close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--white);
}
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }
  .card {
    box-shadow: 0 0 8px rgba(241, 221, 248, 0.5), 0 0 16px rgba(241, 221, 248, 0.35); /* softer glow */
  }
  .popup img {
    max-width: 30%;
  }
  .popup-content h2 {
    margin-top: 15px;
    font-size: 1.6rem;
  }
  .popup-content p {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .main h3 {
    font-size: 1.8rem;
  }
  .main p,
  .tarot-reading p {
    padding: 0 20px;
  }
  .t-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }
  .card-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 20px;
    padding: 0 10px;
  }
  .card {
    padding: 10px;
    box-shadow: 0 0 5px rgba(241, 221, 248, 0.4), 0 0 10px rgba(241, 221, 248, 0.3); /* reduced glow */
  }
  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  .burmese-text p {
    font-size: 1rem;
  }
  .extra-cards {
    display: none;
  }
  .toggle-btn {
    display: block;
  }
  .popup {
    margin: 70px 25px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .popup .dates {
    font-size: 1.1rem;
  }

  .popup-content h2 {
    margin-top: -20px;
    font-size: 2rem;
  }
  .popup-content p {
    font-size: 1rem;
  }
}

/* ------------------------------------------------------ */
.tarot-reading {
  margin-top: 70px;
  text-align: center;
}
.tarot-text {
  margin: 50px 0px;
}
.tarot-text #major {
  font-size: 1.1rem;
}
.tarot-text {
  margin-bottom: 60px;
}
.tarot-reading h3 {
  margin-bottom: 20px;
}
/* Grid for cards */
.tarot_cards {
  display: flex;
  margin: 20px auto;
  max-width: 1100px;
  padding: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 3rem;
}

.major-card,
.minor-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 45%;
}

.major-card:hover,
.minor-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.card-head {
  margin-bottom: 10px;
}

.card-head strong {
  font-size: 1.1rem;
}

.card-image {
  max-height: 300px;
  border-radius: 10px;
  margin-top: 10px;
  animation: cardGlow 2s infinite ease-in-out;
}
/* 
.minor-card .card-image {
  width: -moz-available;
  width: -webkit-fill-availables;
} */

.tarot-hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}

.tarot-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.tarot-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(90deg, #f1ddf8 0%, #a37bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 15px rgba(163, 123, 255, 0.5);
}

.tarot-subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.tarot-reading-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.tarot-deck {
  width: 120px;
  height: 200px;
  background: linear-gradient(145deg, #6a4da3 0%, #300c5c 100%);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(163, 123, 255, 0.7);
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-lavender);
  font-size: 1.5rem;
  z-index: 100;
}

.tarot-deck:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(106, 77, 163, 0.7);
}

.tarot-cards-container {
  margin: 2rem auto;
  position: relative;
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.tarot-cards {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  position: relative;
  row-gap: 3rem;
  width: 100%;
}

.tarot-card {
  width: 120px;
  height: 200px;
  perspective: 1200px;
  position: absolute;
  transition: transform 1s ease;
  border-radius: 20px;
}

.tarot-card.spread-0 {
  transform: translateX(0) rotate(-5deg);
}

.tarot-card.spread-1 {
  transform: translateX(-140px) rotate(-10deg);
}

.tarot-card.spread-2 {
  transform: translateX(140px) rotate(10deg);
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.tarot-card.flipped .tarot-card-inner {
  transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.tarot-card-front {
  background: linear-gradient(145deg, #6a4da3 0%, #300c5c 100%);
  color: var(--light-lavender);
  font-size: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background-image: radial-gradient(
      circle at 25% 25%,
      rgba(255, 255, 255, 0.1) 5px,
      transparent 5px
    ),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 5px, transparent 5px);
  background-size: 30px 30px;
}

.tarot-card-back {
  background-color: #fff;
  background-position: center;
  background-size: cover;
  transform: rotateY(180deg);
  border: 2px solid var(--light-lavender);
  overflow: hidden;
}

.tarot-card-back::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 77, 163, 0.2), rgba(48, 12, 92, 0.2));
  z-index: 1;
}

.tarot-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tarot-card-placeholder {
  width: 120px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 2rem;
}

.tarot-results {
  background: rgba(28, 20, 54, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  display: none;
}

.tarot-results.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

.card-meaning {
  margin-bottom: 1.5rem;
}

.card-img {
  margin-bottom: 1rem;
  width: 150px;
}

.card-name {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--light-lavender);
}
.card-name span {
  font-size: 1rem;
  border-bottom: 1px solid;
  padding-bottom: 3px;
  display: inline-block;
  margin-bottom: 3px;
}

.card-description {
  opacity: 0.9;
  line-height: 1.6;
}

.tarot-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-tarot {
  background: linear-gradient(135deg, #a37bff 0%, var(--medium-purple) 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(106, 77, 163, 0.4);
}

.btn-tarot:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(106, 77, 163, 0.5);
}

.btn-tarot-outline {
  background: transparent;
  color: var(--light-lavender);
  border: 1px solid rgba(241, 221, 248, 0.3);
}

.btn-tarot-outline:hover {
  background: rgba(241, 221, 248, 0.1);
  border-color: rgba(241, 221, 248, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes drawCard {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes cardGlow {
  0% {
    box-shadow: 0 0 15px rgba(163, 123, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(163, 123, 255, 0.9);
  }
  100% {
    box-shadow: 0 0 15px rgba(163, 123, 255, 0.5);
  }
}

.draw-animation {
  animation: drawCard 0.5s ease;
}

.card-glow {
  animation: cardGlow 2s infinite ease-in-out;
}

@media (max-width: 768px) {
  .tarot-cards {
    gap: 1rem;
  }
  .tarot-text h3 {
    font-size: 1.7rem;
  }
  .tarot-text #major {
    padding: 0px 20px;
    font-size: 1rem;
  }
  .tarot-title {
    font-size: 1.5rem;
  }

  .tarot-subtitle {
    font-size: 1rem;
  }

  .tarot-actions {
    flex-direction: column;
    align-items: center;
  }
  .major {
    font-size: 0.5rem;
  }
  .tarot-card,
  .tarot-card-placeholder {
    width: 100px;
    height: 160px;
  }

  .tarot-card.spread-1 {
    transform: translateX(-110px) rotate(-10deg);
  }

  .tarot-card.spread-2 {
    transform: translateX(110px) rotate(10deg);
  }
}

@media (max-width: 520px) {
  .card-image {
    max-height: 220px;
  }

  .major-card,
  .minor-card {
    width: 100%;
  }
}
