/* Optimized styles for Tarot Card Reading */

/* General styles */
body {
    font-family: 'Poppins', sans-serif;
    overflow-y: auto;
    min-height: 100vh;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Enhanced text styles */
.main-title {
    background: linear-gradient(135deg, #ff0066, #9D053E, #ff0066);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(157, 5, 62, 0.3);
    letter-spacing: 0.5px;
    font-weight: 900;
}

.cta-text {
    background: linear-gradient(135deg, #ff0066, #9D053E, #ff0066);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
}

.instruction-container {
    background: linear-gradient(135deg, rgba(255, 102, 153, 0.7), rgba(255, 0, 102, 0.7));
    border-radius: 30px;
    padding: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.instruction-text {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #9D053E;
}

.cta-button {
    background: linear-gradient(135deg, #ff0066, #9D053E);
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-weight: 800;
    letter-spacing: 0.8px;
    box-shadow: 0 5px 20px rgba(157, 5, 62, 0.7), 0 0 15px rgba(255, 0, 102, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(157, 5, 62, 0.9), 0 0 20px rgba(255, 0, 102, 0.7);
}

/* Progress bar container */
.progress-container {
    width: 100%;
    max-width: 300px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    margin: 15px auto;
    display: flex;
    justify-content: space-between;
    padding: 2px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden;
    position: relative;
}

.progress-segment {
    flex: 1;
    height: 100%;
    margin: 0 3px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-segment-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ff0066, #ff4081);
    border-radius: 8px;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px rgba(255, 0, 102, 0.7);
}

.progress-segment.active .progress-segment-fill {
    width: 100%;
}

/* Reading message container */
.reading-message {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 245, 0.95));
    border: 2px solid #ff0066;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 0, 102, 0.3);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.8s ease;
    position: relative;
    overflow: hidden;
}

.reading-message.visible {
    transform: translateY(0);
    opacity: 1;
}

.reading-message h3 {
    color: #9D053E;
    font-size: 1.7rem;
    margin-bottom: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.reading-message p {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.reading-message-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ff0066;
}

/* Card styles */
.card {
    width: 120px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
}

.card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='24px' height='24px'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s;
}

.card.flipped::after {
    opacity: 0;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
}

.card-front {
    transform: rotateY(180deg);
}

.card-back img,
.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

/* Selected card styles */
.card.selected {
    pointer-events: none;
}

/* Final cards container */
.final-cards-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px;
    position: relative;
    width: 100%;
    padding: 20px 0;
    max-width: 400px;
    margin: 0 auto;
}

.final-cards-container .card {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    flex: 0 0 auto;
    width: 120px;
}

.card.selected-final {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 120px;
    height: 200px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    position: static !important;
    margin: 0 !important;
    transform: none !important;
}

.card.middle-card {
    width: 120px;
    height: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    position: static !important;
    margin: 0 !important;
    transform: none !important;
    top: auto !important;
}

/* Remove hover effects for selected cards */
.card.selected:hover,
.card.selected-final:hover,
.card.middle-card:hover,
.final-cards-container .card:hover {
    transform: none !important;
}

#ctaButton a {
    padding: 15px 30px;
    font-size: 1.3rem;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1.5s ease-out forwards;
}

/* Slow pulse animation for CTA text */
@keyframes pulseSlow {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

.animate-pulse-slow {
    animation: pulseSlow 3s infinite;
}

/* Accessibility focus styles */
a:focus,
button:focus {
    outline: 2px solid #ff0066;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .card {
        width: 90px;
        height: 150px;
    }

    .card::after {
        width: 30px;
        height: 30px;
    }

    .card.selected-final {
        width: 90px;
        height: 150px;
    }

    .card.middle-card {
        width: 90px;
        height: 150px;
    }

    .final-cards-container {
        gap: 15px;
    }

    .reading-message {
        padding: 15px;
        margin-top: 20px;
    }

    .reading-message h3 {
        font-size: 1.2rem;
    }

    .reading-message p {
        font-size: 1rem;
    }

    #ctaButton a {
        padding: 12px 25px;
        font-size: 1.1rem;
    }
}