/**
 * 人生红点塔罗牌式卡牌样式
 * 为自我诊断系统提供互动式塔罗牌抽取体验
 */

/* 塔罗牌容器 */
.tarot-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    perspective: 1000px;
    margin: 3rem 0;
}

/* 卡牌抽取区域 */
.card-drawing-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.card-deck {
    position: relative;
    width: 200px;
    height: 300px;
    margin-bottom: 2rem;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-deck::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/redpoint-card-back.jpg') center/cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-deck::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    background: url('../images/redpoint-card-back.jpg') center/cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: -1;
}

.card-deck:hover {
    transform: translateY(-10px) rotateX(5deg);
}

.draw-instruction {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
}

.draw-button {
    padding: 1rem 2rem;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

.draw-button:hover {
    background-color: #b71c1c;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.4);
}

.draw-button i {
    margin-right: 0.8rem;
}

/* 塔罗牌样式 */
.tarot-card {
    position: relative;
    width: 200px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 1s ease;
    cursor: pointer;
}

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

.tarot-card-front, .tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tarot-card-front {
    background: url('../images/redpoint-card-back.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarot-card-back {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    transform: rotateY(180deg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 5px solid #d32f2f;
}

/* 卡牌内容样式 */
.tarot-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d32f2f;
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
}

.tarot-card-image {
    width: 100%;
    height: 120px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.tarot-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tarot-card-description {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
    flex: 1;
    overflow-y: auto;
}

/* 洗牌区域样式 */
.shuffling-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.shuffling-deck {
    position: relative;
    width: 250px;
    height: 350px;
    margin-bottom: 2rem;
    perspective: 1000px;
}

/* 洗牌卡牌光效 */
.deck-glow-effect {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(211, 47, 47, 0.3) 0%, rgba(211, 47, 47, 0) 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseGlow 2s infinite alternate ease-in-out;
    z-index: -1;
    opacity: 0.7;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.shuffling-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 300px;
    background: url('../images/redpoint-card-back.svg') center/cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(211, 47, 47, 0.3);
    transform: translate(-50%, -50%);
    animation: shuffleCards 2s infinite alternate ease-in-out;
    transform-origin: center;
    transition: all 0.3s ease;
}

.shuffling-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 100%);
    border-radius: 15px;
    z-index: 2;
}

.shuffling-text {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
    position: relative;
}

.shuffling-text .dots span {
    display: inline-block;
    animation: dotPulse 1.4s infinite;
    animation-fill-mode: both;
    margin-left: 2px;
}

.shuffling-text .dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.shuffling-text .dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes shuffleCards {
    0% {
        transform: translate(-50%, -50%) rotate(var(--rotation)) translate(var(--translate-x), var(--translate-y)) scale(var(--scale));
    }
    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--rotation) * -0.7)) translate(calc(var(--translate-x) * -0.7), calc(var(--translate-y) * -0.7)) scale(calc(var(--scale) * 1.1));
    }
}

/* 卡牌选择区域样式 */
.card-selection-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

/* 背景光效 */
.selection-bg-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(211, 47, 47, 0.05) 0%, rgba(211, 47, 47, 0) 70%);
    z-index: -1;
    animation: bgPulse 8s infinite alternate ease-in-out;
}

@keyframes bgPulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.selection-prompt {
    font-size: 1.3rem;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    position: relative;
}

.magic-text {
    position: relative;
    display: inline-block;
    padding: 0 10px;
}

.magic-text::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(211, 47, 47, 0) 0%, rgba(211, 47, 47, 0.8) 50%, rgba(211, 47, 47, 0) 100%);
    animation: lineGlow 3s infinite;
}

@keyframes lineGlow {
    0% { width: 0; left: 50%; opacity: 0; }
    50% { width: 100%; left: 0; opacity: 1; }
    100% { width: 0; left: 50%; opacity: 0; }
}

.card-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.selectable-card {
    width: 180px;
    height: 270px;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    animation: cardAppear 0.5s forwards;
    opacity: 0;
    animation-delay: calc(var(--card-index) * 0.1s);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: url('../images/redpoint-card-back.svg') center/cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.selectable-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.selectable-card:hover .card-glow {
    opacity: 0.3;
    animation: moveGlow 2s infinite alternate ease-in-out;
}

@keyframes moveGlow {
    0% { transform: translate(-30%, -30%) scale(1); }
    100% { transform: translate(-70%, -70%) scale(1.2); }
}

.selectable-card.selecting {
    animation: cardSelect 0.3s forwards;
}

@keyframes cardSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.selectable-card.selected {
    border: 3px solid #d32f2f;
    box-shadow: 0 0 20px rgba(211, 47, 47, 0.5);
    transform: translateY(-15px) scale(1.05);
    pointer-events: none;
}

.card-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #d32f2f;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    animation: checkmarkAppear 0.3s forwards;
    z-index: 10;
}

@keyframes checkmarkAppear {
    0% { transform: scale(0) rotate(-90deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.card-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    z-index: 5;
    animation: flashEffect 0.3s forwards;
    pointer-events: none;
}

@keyframes flashEffect {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

.fullscreen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 1000;
    animation: fullscreenFlash 0.5s forwards;
    pointer-events: none;
}

@keyframes fullscreenFlash {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 0; }
}

.card-collect {
    animation: collectCard 1s forwards;
    animation-delay: var(--collect-delay);
}

@keyframes collectCard {
    0% { transform: translateY(-15px) scale(1.05); }
    50% { transform: translateY(-100px) scale(0.8); opacity: 1; }
    100% { transform: translateY(-200px) scale(0.5); opacity: 0; }
}

.selection-counter {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
    position: relative;
}

.counter-text {
    position: relative;
    display: inline-block;
}

.counter-number {
    display: inline-block;
    color: #d32f2f;
    font-weight: 700;
}

.counter-update {
    animation: counterUpdate 0.5s forwards;
}

@keyframes counterUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 分析提示样式 */
.analysis-hint {
    margin-top: 2rem;
    max-width: 800px;
    width: 100%;
}

.analysis-content {
    background-color: rgba(211, 47, 47, 0.05);
    border-left: 3px solid #d32f2f;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* 卡牌抽取动画 */
@keyframes drawCard {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(-50px) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateY(300px) scale(1);
        opacity: 0;
    }
}

@keyframes cardAppear {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.drawing-animation {
    animation: drawCard 1s forwards;
}

.appear-animation {
    animation: cardAppear 1s forwards;
}

/* 结果区域样式 */
.redpoint-result {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.result-subtitle {
    font-size: 1.1rem;
    color: #666;
}

.result-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    width: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(211, 47, 47, 0.2);
}

.result-card-header {
    background-color: #d32f2f;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.result-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-card-subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

.result-card-content {
    padding: 1.5rem;
}

.result-card-description {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.result-card-features {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 1.5rem;
}

.result-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.result-feature:last-child {
    margin-bottom: 0;
}

.feature-icon {
    width: 30px;
    height: 30px;
    background-color: rgba(211, 47, 47, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 1rem;
    color: #d32f2f;
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.3rem;
}

.feature-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* 下载按钮样式 */
.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.download-button {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.download-redpoint {
    background-color: #d32f2f;
    color: white;
    border: none;
}

.download-redpoint:hover {
    background-color: #b71c1c;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

.download-plan {
    background-color: white;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.download-plan:hover {
    background-color: #e8f5e9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.2);
}

.download-button i {
    margin-right: 0.8rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tarot-container {
        gap: 1rem;
    }
    
    .result-cards {
        gap: 1rem;
    }
    
    .result-card {
        width: 100%;
        max-width: 350px;
    }
    
    .download-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 350px;
    }
    
    .download-button {
        width: 100%;
    }
}
