/* Custom styles for mystical tarot experience */

.cosmic-bg {
  background: linear-gradient(135deg, #1a0033 0%, #0f0129 25%, #1a0033 50%, #2d1b69 75%, #1a0033 100%);
  background-size: 400% 400%;
  animation: cosmicShift 20s ease infinite;
  position: relative;
}

.cosmic-bg::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #ffd700, transparent),
    radial-gradient(2px 2px at 40px 70px, #ffd700, transparent),
    radial-gradient(1px 1px at 90px 40px, #ffd700, transparent),
    radial-gradient(1px 1px at 130px 80px, #ffd700, transparent),
    radial-gradient(2px 2px at 160px 30px, #ffd700, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: starTwinkle 3s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes cosmicShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.mystical-text {
  text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700, 0 0 60px #ffd700;
  animation: mysticalGlow 2s ease-in-out infinite alternate;
}

@keyframes mysticalGlow {
  from { text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700, 0 0 40px #ffd700; }
  to { text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffd700, 0 0 40px #ffd700, 0 0 50px #ffd700; }
}

.tarot-card {
  width: 140px;
  height: 200px;
  perspective: 1000px;
}

.card-inner {
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

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

.card-front, .card-back {
  backface-visibility: hidden;
  border-radius: 8px;
}

.card-front {
  transform: rotateY(180deg);
}

.card-back {
  background: linear-gradient(135deg, #4c1d95 0%, #312e81 50%, #4c1d95 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 215, 0, 0.2);
}

.card-front {
  background: linear-gradient(to bottom, #f3e8ff, #e9d5ff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 215, 0, 0.1);
}

.tarot-card:hover {
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
}

.tarot-card.selected {
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
}

/* Upload zone styling */
.upload-zone {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  transition: all 0.3s ease;
}

.upload-zone:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.1);
}

/* Loading animation for cards */
@keyframes mysticalPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.tarot-card .card-front img {
  transition: opacity 0.3s ease;
}

/* Style for range sliders */
input[type="range"] {
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  background: rgba(139, 92, 246, 0.3);
  height: 6px;
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  background: #ffd700;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

input[type="range"]::-moz-range-track {
  background: rgba(139, 92, 246, 0.3);
  height: 6px;
  border-radius: 3px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  background: #ffd700;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* Gold color utility */
.text-gold {
  color: #ffd700;
}

.bg-gold {
  background-color: #ffd700;
}

.border-gold {
  border-color: #ffd700;
}

/* Custom scrollbar for history */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(79, 70, 229, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.5);
}

/* Enhanced mystical effects */
.upload-zone::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upload-zone:hover::before {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tarot-card {
    width: 100px;
    height: 140px;
  }
  
  .mystical-text {
    font-size: 2.5rem;
  }
  
  .cosmic-bg::before {
    background-size: 150px 75px;
  }
  
  .upload-zone {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .tarot-card {
    width: 80px;
    height: 120px;
  }
  
  .mystical-text {
    font-size: 2rem;
  }
  
  .upload-zone {
    padding: 1rem;
  }
}