/* Custom styles for Tarot Card Reading */

/* General styles */
body {
    font-family: 'Poppins', sans-serif;
    overflow-y: auto; /* Permitir rolagem vertical */
    min-height: 100vh;
    touch-action: pan-x pan-y; /* Impedir zoom com gestos */
    -ms-touch-action: pan-x pan-y;
    -webkit-touch-callout: none; /* Impedir menu de contexto em toque longo */
    -webkit-user-select: none; /* Impedir seleção de texto */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Background overlay with stars - removed dark overlay */
.absolute.inset-0.z-0::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Enhanced text styles for better contrast */
.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;
    animation: pulse-bg 3s infinite ease-in-out;
    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; /* Primary brand color */
}

.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:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -50%;
        top: -50%;
    }
    100% {
        left: 150%;
        top: 150%;
    }
}

/* Progress bar container - improved design for light background */
.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-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Progress segments */
.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 */
.progress-segment-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #ff0066, #ff4081);
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(255, 0, 102, 0.7);
}

/* Progress segment active */
.progress-segment.active .progress-segment-fill {
    width: 100%;
    animation: progressGlow 1s ease;
}

/* Reading message container - more alarming and modern, but lighter */
.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::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 0, 102, 0.8), transparent);
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

.reading-message.visible {
    transform: translateY(0);
    opacity: 1;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 0, 102, 0.3);
    }
    50% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 0, 102, 0.6);
    }
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 0, 102, 0.3);
    }
}

.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;
    animation: pulse-icon 1.5s infinite;
}

@keyframes pulse-icon {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Progress bar glow effect */
@keyframes progressGlow {
    0% {
        box-shadow: 0 0 8px rgba(157, 5, 62, 0.7);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 102, 0.9);
    }
    100% {
        box-shadow: 0 0 8px rgba(157, 5, 62, 0.7);
    }
}

/* Pulsing background animation */
@keyframes pulse-bg {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* Twinkling stars effect */
@keyframes twinkle {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.star {
    position: absolute;
    background-color: #FFD700; /* Golden color */
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.8); /* Golden glow */
    border-radius: 50%;
    z-index: 2;
    animation: twinkle var(--duration, 4s) infinite ease-in-out;
    animation-delay: var(--delay, 0s);
}

/* Card styles */
.card {
    width: 120px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
    animation: float 3s infinite ease-in-out;
    animation-delay: calc(var(--card-index, 0) * 0.2s);
    border-radius: 15px; /* Adicionado border-radius */
    overflow: hidden;
}

/* Floating animation for cards */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

.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:hover {
    transform: translateY(-10px);
    animation-play-state: paused;
}

.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; /* Adicionado border-radius */
}

.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; /* Adicionado border-radius */
    overflow: hidden;
}

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

.card-back img, .card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px; /* Adicionado border-radius */
}

/* Selected card styles */
.card.selected {
    pointer-events: none;
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* 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;
}

/* Selected final layout styles */
.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;
}

/* Middle card styles */
.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 and animations for selected cards */
.card.selected:hover,
.card.selected-final:hover,
.card.middle-card:hover,
.final-cards-container .card:hover {
    transform: none !important;
    animation: none !important;
    transition: none !important;
}

/* Disabled card styles */
.card.disabled {
    opacity: 0.5;
    pointer-events: none;
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* Animation for the CTA button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(157, 5, 62, 0.7), 0 0 15px rgba(255, 0, 102, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 25px rgba(157, 5, 62, 0.9), 0 0 20px rgba(255, 0, 102, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(157, 5, 62, 0.7), 0 0 15px rgba(255, 0, 102, 0.5);
    }
}

#ctaButton a {
    animation: pulse 2s infinite;
    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;
}

/* Subtle bounce animation for finger emoji */
@keyframes bounceSlight {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.animate-bounce-subtle {
    animation: bounceSlight 1.5s infinite;
    display: inline-block;
}

/* 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;
    }
}
