/* Tarot Floating Action Button */
.tarot-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
  cursor: pointer;
  z-index: 9999;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tarot-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

/* Tarot Modal */
.tarot-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.tarot-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.tarot-modal {
  background: linear-gradient(to bottom, #1e1b4b, #312e81);
  color: #e2e8f0;
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(167, 139, 250, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.tarot-modal-overlay.active .tarot-modal {
  transform: scale(1);
}

.tarot-modal h2 {
  margin: 0 0 8px 0;
  font-size: 26px;
  color: #c4b5fd;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.tarot-modal .subtitle {
  text-align: center;
  color: #a78bfa;
  font-size: 14px;
  margin-bottom: 24px;
}

.tarot-modal .close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  color: #a78bfa;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.tarot-modal .close-btn:hover {
  color: white;
}

/* Tarot Action Buttons */
.tarot-btn {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 0 auto 20px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: white;
  font-weight: bold;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}
.tarot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}
.tarot-btn:disabled {
  background: #475569;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

/* Card Spread Area */
.tarot-spread {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
  perspective: 1000px;
}

/* Individual Card */
.tarot-card {
  width: 80px;
  height: 120px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1), box-shadow 0.3s;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.tarot-card.hidden-deck {
  display: none;
}
.tarot-card:hover:not(.flipped):not(.selected) {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}
.tarot-card.selected {
  transform: translateY(-20px) scale(1.05);
  box-shadow: 0 0 15px #a78bfa;
  pointer-events: none;
}
.tarot-card.flipped {
  transform: rotateY(180deg) scale(1.1);
  box-shadow: 0 15px 30px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 10;
  margin: 0 10px; /* give some space when expanded */
}

/* Card Faces */
.tarot-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.1);
}

.tarot-card-back {
  background-image: url('./tarot_images/tarot_back.png');
  background-size: cover;
  background-position: center;
  color: transparent;
}

.tarot-card-front {
  background: #f8fafc;
  transform: rotateY(180deg);
  padding: 8px;
  box-sizing: border-box;
  flex-direction: column;
  border: 4px solid #fbbf24;
}
.tarot-card-front .card-img-placeholder {
  flex: 1;
  width: 100%;
  background: #e2e8f0;
  border-radius: 4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 20px;
}
.tarot-card-front .card-title {
  color: #0f172a;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

/* Results Section */
.tarot-result-area {
  display: none;
  animation: fadeIn 0.5s forwards;
}
.tarot-result-area.active {
  display: block;
}
.tarot-reading-item {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid #a855f7;
}
.tarot-reading-item h4 {
  margin: 0 0 8px 0;
  color: #fbbf24;
  font-size: 16px;
}
.tarot-reading-item p {
  margin: 0;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .tarot-fab {
    bottom: 125px;
    left: 50%;
    transform: translateX(-100%);
    margin-left: -5px;
    padding: 10px 14px;
    font-size: 13px;
    width: max-content;
  }
  .tarot-fab:hover {
    transform: translateX(-100%) translateY(-3px);
  }
}
