/* Tarot Reading Calculator - Premium Mystical 3D Card & Shuffler Styling */

.apple-glass {
    background: rgba(20, 16, 32, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

html:not(.dark) .apple-glass {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(217, 119, 6, 0.2);
    box-shadow: 0 10px 30px -5px rgba(217, 119, 6, 0.1);
}

.preset-active {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: rgba(245, 158, 11, 0.7) !important;
    color: #fbbf24 !important;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

html:not(.dark) .preset-active {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Premium Shuffle Button Design */
.btn-tarot-shuffle {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    border: 1px solid rgba(254, 243, 199, 0.5);
    box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.4), 0 0 15px rgba(245, 158, 11, 0.25);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-tarot-shuffle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px -4px rgba(245, 158, 11, 0.55), 0 0 25px rgba(245, 158, 11, 0.35);
}

.btn-tarot-shuffle:active {
    transform: translateY(1px) scale(0.97);
}

/* 3D Card Flip Container - Compact & Visible without scrolling */
.tarot-card-container {
    perspective: 1000px;
    width: 120px;
    height: 190px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    user-select: none;
}

@media (min-width: 640px) {
    .tarot-card-container {
        width: 145px;
        height: 220px;
    }
}

.tarot-card-container:hover {
    transform: translateY(-5px) scale(1.02);
    filter: drop-shadow(0 12px 20px rgba(245, 158, 11, 0.3));
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

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

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

.tarot-card-front, .tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    overflow: hidden;
}

/* Card Back Design - Premium Sacred Geometry (Dark Mode) */
.tarot-card-back {
    background: radial-gradient(circle, #2a1f42 0%, #1a1429 60%, #0d0a17 100%);
    border: 2px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(245, 158, 11, 0.15);
}

/* Card Back Design - Light Mode */
html:not(.dark) .tarot-card-back {
    background: radial-gradient(circle, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.2), inset 0 0 15px rgba(245, 158, 11, 0.25);
}

.tarot-card-back-pattern {
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(245, 158, 11, 0.45);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.12) 0%, transparent 70%),
        repeating-linear-gradient(45deg, rgba(245, 158, 11, 0.03) 0, rgba(245, 158, 11, 0.03) 10px, transparent 10px, transparent 20px);
    position: relative;
}

/* Card Front Design - Dark Mode */
.tarot-card-front {
    background: linear-gradient(145deg, #1e192d 0%, #120e1e 100%);
    border: 2px solid rgba(245, 158, 11, 0.7);
    transform: rotateY(180deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(245, 158, 11, 0.15);
}

/* Card Front Design - Light Mode */
html:not(.dark) .tarot-card-front {
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 12px 25px rgba(217, 119, 6, 0.2);
}

/* Shuffling Animation Effect */
.shuffling-animation {
    animation: tarotShuffle 0.5s ease-in-out infinite alternate;
}

@keyframes tarotShuffle {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(0.95) rotate(-4deg);
    }
    100% {
        transform: scale(1.03) rotate(4deg);
    }
}
