/* Tarot Reading Page Styles */

/* Apply mystical fonts */
.tarot-read {
    padding: 0;
    background: transparent;
    min-height: 100vh;
    font-family: 'Cinzel', serif;
    position: relative;
    overflow-x: hidden;
}

.tarot-read > * {
    position: relative;
    z-index: 1;
}

.tarot-read h1,
.tarot-read h2,
.tarot-read h3,
.tarot-read h4,
.tarot-read .btn {
    font-family: 'Cinzel Decorative', serif;
}

/* Override Bootstrap body and main background */
body {
    background: transparent !important;
    font-family: 'Cinzel', serif;
    position: relative;
    overflow-x: hidden;
}

html {
    background: #121330 !important;
}

#main {
    background: transparent !important;
}

#footer {
    background: rgba(0,0,0,0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Aurora Borealis Layers */
.aurora {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.55;
    animation: aurora-shift ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
    will-change: opacity;
}

.aurora-1 {
    background:
        radial-gradient(ellipse 100% 75% at 50% 50%, rgba(148, 0, 211, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse 90% 65% at 45% 48%, rgba(0, 255, 127, 0.6) 0%, transparent 60%),
        radial-gradient(ellipse 85% 60% at 55% 52%, rgba(30, 144, 255, 0.65) 0%, transparent 60%);
    animation-duration: 20s;
    animation-delay: 0s;
}

@keyframes aurora-shift {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.65; }
}

/* Stars */
.stars {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
}

.star-small {
    width: 1px;
    height: 1px;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

.star-medium {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 0 8px rgba(200, 220, 255, 0.5);
}

.star-large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 1), 0 0 12px rgba(180, 200, 255, 0.7);
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Ambient glow */
.ambient-glow {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(138, 43, 226, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(0, 255, 150, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(100, 149, 237, 0.05) 0%, transparent 50%);
    animation: glow-pulse 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.tarot-read h1 {
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-top: 40px;
}

.reading-instructions {
    color: #fff;
}

.reading-instructions .lead {
    font-size: 1.3rem;
}

#selection-status-tarot {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#selection-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Card Grid Layout - 13x6 grid for 78 cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto 30px;
    padding: 20px;
    background: transparent;
}

@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
}

/* Individual Card Styles */
.tarot-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    cursor: pointer;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.tarot-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.card-back {
    background: #173B6B;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffd700;
}

.card-back::after {
    content: "✦";
    font-size: 2rem;
    color: #ffd700;
}

.card-front {
    transform: rotateY(180deg);
    overflow: hidden;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card States */
.tarot-card:hover:not(.selected):not(.disabled) .card-inner {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.tarot-card.selected {
    animation: pulse 0.5s ease;
}

.tarot-card.selected .card-face {
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.tarot-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Question Section */
.question-section {
    max-width: 700px;
    margin: 30px auto;
    animation: fadeIn 0.5s ease;
}

.question-section .card {
    background: rgba(10, 14, 39, 0.92);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.question-section h3 {
    color: #ffd700;
    text-align: center;
}

.question-section .form-control {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: transparent;
    color: #fff;
}

.question-section .form-control::placeholder {
    color: rgba(255, 255, 255, 1);
}

.question-section .form-control:focus {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    background: transparent;
    color: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Reading Result */
.reading-result {
    max-width: 900px;
    margin: 30px auto;
    animation: fadeIn 0.5s ease;
}

.reading-result .card {
    background: transparent;
    backdrop-filter: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.selected-cards-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
    background: transparent;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 30px !important;
}

.selected-card-item {
    text-align: center;
}

.selected-card-item img {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.selected-card-item .card-name {
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
    color: #ffd700;
    font-size: 0.9rem;
}

#reading-content {
    background: transparent;
    padding: 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1.8;
    font-family: 'Cinzel', serif;
    color: #fff;
}

#reading-content h4 {
    font-family: 'Cinzel Decorative', serif;
    color: #ffd700;
    margin-top: 25px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#reading-content p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

#reading-content hr {
    border-color: rgba(255, 215, 0, 0.3);
    margin: 20px 0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #ffd700;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(102, 126, 234, 0.5);
    cursor: wait;
    transform: none;
}

.btn-secondary {
    padding: 12px 30px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: "Loading cards...";
    font-size: 1.2rem;
    color: #fff;
}

/* Full-screen result display */
.reading-result.fullscreen-result {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    background: #121330;
    padding: 0;
    margin: 0;
}

.reading-result.fullscreen-result .card {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    background: rgba(15, 20, 40, 0.95);
    border: none;
    border-radius: 0;
}

.fullscreen-result .card-body {
    padding: 3rem;
}

/* Reading Tabs */
.reading-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background: transparent;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.reading-tab-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 15px 25px;
    color: #ffd700;
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reading-tab-btn:hover {
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.reading-tab-btn.active {
    text-shadow: 0 0 15px rgba(255, 215, 0, 1);
}

.tab-icon {
    font-size: 2rem;
}

.tab-card-icon {
    width: 50px;
    height: auto;
    border-radius: 5px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.reading-tab-btn:hover .tab-card-icon {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.reading-tab-btn.active .tab-card-icon {
    border-color: rgba(255, 215, 0, 1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.tab-label {
    font-size: 0.9rem;
}

/* Reading Content */
.reading-content {
    position: relative;
    min-height: 300px;
}

.card-content {
    display: none;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-left-width: 5px;
    animation: cardFade 0.5s ease;
}

.card-content.active {
    display: block;
}

/* Colored bars for each card */
.card-content[data-card="card1"] {
    border-left-color: #60a5fa;
}

.card-content[data-card="card2"] {
    border-left-color: #f472b6;
}

.card-content[data-card="card3"] {
    border-left-color: #a78bfa;
}

.card-content[data-card="overall"] {
    border-left-color: #fbbf24;
}

@keyframes cardFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Share Button Styles */
.btn-share {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(16, 185, 129, 0.6);
    color: #fff;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.btn-share:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.btn-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}