/* Tarot Picker Styles */
.tarot-picker-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    color: #333;
}

.tarot-picker-header {
    text-align: center;
    margin-bottom: 30px;
}

.tarot-picker-header h2 {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tarot-picker-header p {
    font-size: 1.2em;
    margin: 0;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Deck Container */
.tarot-deck-container {
    margin: 30px 0;
    text-align: center;
}

.deck-instructions {
    margin-bottom: 20px;
}

.deck-instructions p {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-weight: 500;
}

.selection-counter {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    color: #495057;
}

#selected-count {
    color: #007bff;
    font-size: 1.3em;
}

/* Tarot Deck - Horizontal spread */
.tarot-deck {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: -20px; /* Negative gap for overlapping */
    max-width: 100%;
    margin: 0 auto 30px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 15px;
    border: 1px solid #e9ecef;
    min-height: 200px;
    overflow: hidden;
}

/* Card Container for 3D flip effect */
.tarot-card-container {
    width: 120px;
    height: 180px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    margin-left: -20px; /* Overlap effect */
    z-index: 1;
}

.tarot-card-container:first-child {
    margin-left: 0; /* First card doesn't need left margin */
}

.tarot-card-container:hover {
    z-index: 10; /* Bring hovered card to front */
    transform: translateY(-5px) scale(1.05);
}

.tarot-card-container.selected {
    transform: translateY(-8px) scale(1.1);
}

.tarot-card-container.disabled {
    cursor: not-allowed;
    transform: none;
}

.tarot-card-container.disabled:hover {
    transform: none;
}

/* Card faces */
.tarot-card-back, .tarot-card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backface-visibility: hidden;
    transition: transform 0.6s;
}

/* Card back - realistic tarot card back */
.tarot-card-back {
    background-image: url('../images/tarot-cards/back_card.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #333;
    border-radius: 12px;
}

/* Card front - shows the actual card */
.tarot-card-front {
    background: white;
    border: 2px solid #ddd;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.tarot-card-front.reversed img {
    transform: rotate(180deg);
}

/* Flipped state */
.tarot-card-container.flipped .tarot-card-back {
    transform: rotateY(180deg);
}

.tarot-card-container.flipped .tarot-card-front {
    transform: rotateY(0deg);
}

/* Selection states */
.tarot-card-container.selected .tarot-card-back {
    border-color: #007bff;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.tarot-card-container.selected .tarot-card-front {
    border-color: #007bff;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

/* Deck Actions */
.deck-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.shuffle-button, .reset-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reset-button {
    background: #dc3545;
}

.shuffle-button:hover, .reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.shuffle-button.disabled, .reset-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.shuffle-button.disabled:hover, .reset-button.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.shuffle-button:active, .reset-button:active {
    transform: translateY(0);
}

.cards-display {
    margin: 30px 0;
    animation: fadeInUp 0.6s ease-out;
}

.cards-display h3 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.cards-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.reading-cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tarot-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    color: #333;
    position: relative;
    overflow: hidden;
}

/* Remove overlay from card front images */
.tarot-card-front::before {
    display: none;
}

.tarot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.card-name {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-meaning {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 10px;
    color: #34495e;
    font-style: italic;
}

.card-description {
    font-size: 0.9em;
    line-height: 1.5;
    color: #7f8c8d;
    margin-top: 10px;
}

.card-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: white;
    transition: transform 0.3s ease;
}

.card-image.reversed {
    transform: rotate(180deg);
}

/* Position tags are now above cards, no need for counter-rotation */

.reading-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    color: #333;
    position: relative;
    overflow: hidden;
    min-width: 320px;
    max-width: 380px;
    flex: 1;
}

/* Remove overlay from reading card images */
.reading-card::before {
    display: none;
}

.reading-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.card-position {
    position: relative;
    top: 0;
    right: 0;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    display: inline-block;
}

.tarot-picker-cta {
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.tarot-picker-cta p {
    font-size: 1.3em;
    margin: 0 0 20px 0;
    font-weight: 500;
    color: #495057;
}

.tarot-cta-button {
    display: inline-block;
    background: #28a745;
    color: white !important;
    text-decoration: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tarot-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #218838;
    color: white !important;
    text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

.card-flip {
    animation: cardFlip 0.6s ease-in-out;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .tarot-picker-container {
        margin: 10px;
        padding: 15px;
    }
    
    .tarot-picker-header h2 {
        font-size: 2em;
    }
    
    .tarot-picker-header p {
        font-size: 1.1em;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tarot-card {
        padding: 15px;
    }
    
    .card-name {
        font-size: 1.2em;
    }
    
    .tarot-pick-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }
    
    .tarot-cta-button {
        padding: 12px 25px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .tarot-picker-header h2 {
        font-size: 1.8em;
    }
    
    .tarot-picker-header p {
        font-size: 1em;
    }
    
    .tarot-pick-button {
        padding: 10px 25px;
        font-size: 1em;
    }
    
    .tarot-cta-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}
