/* 🖼️ 图片卡片系统样式 */

/* 卡片容器样式 */
#wish-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* 图片卡片加载动画 */
.image-card-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #FFD700;
    text-align: center;
}

.image-card-loading .loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.image-card-loading .spinner-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-card-loading .spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: #FFA500;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.image-card-loading .spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: #DAA520;
    animation-duration: 2s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-card-loading .loading-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.image-card-loading .loading-progress {
    width: 300px;
    max-width: 80vw;
}

.image-card-loading .progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.image-card-loading .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.image-card-loading .progress-text {
    font-size: 0.9em;
    color: rgba(255, 215, 0, 0.8);
}

/* 图片卡片主体 - 全屏显示 */
.image-wish-card {
    position: relative;
    width: 90vw;
    max-width: 400px;
    height: 70vh;
    max-height: 600px;
    margin: 0 auto;
    cursor: pointer;
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.image-wish-card:hover {
    transform: scale(1.02);
}

.image-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-wish-card.flipped .image-card-inner {
    transform: rotateY(180deg);
}

/* 翻转时的视觉效果 */
.image-wish-card.flipping {
    transform: scale(1.05);
}

.image-wish-card.flipping .image-card-inner {
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.3);
}

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

.image-card-front {
    z-index: 2;
}

.image-card-back {
    transform: rotateY(180deg);
    z-index: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 卡片正面 - 图片容器 */
.card-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    color: white;
}

.card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-number {
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.card-level {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-title {
    font-size: 1.1em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.card-fairy {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 卡片背面内容 */
.card-back-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
}

.wish-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.wish-label {
    font-size: 0.8em;
    color: #FFD700;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wish-text {
    font-size: 0.9em;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.blessing-section {
    text-align: center;
    margin-bottom: 15px;
}

.fairy-avatar {
    font-size: 2em;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.fairy-name {
    font-size: 1em;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 8px;
}

.blessing-text {
    font-size: 0.8em;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.category-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.category-label {
    font-size: 0.7em;
    color: rgba(255, 215, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.category-name {
    font-size: 0.9em;
    font-weight: 600;
    color: white;
}

.energy-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.energy-label {
    font-size: 0.7em;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}

.energy-bar {
    position: relative;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FF6B6B);
    border-radius: 6px;
    transition: width 1s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.energy-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7em;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 卡片出现动画 */
.image-wish-card.card-appear {
    animation: cardAppear 0.8s ease-out;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(-90deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1) rotateY(-45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-wish-card {
        width: 95vw;
        max-width: 350px;
        height: 75vh;
        max-height: 550px;
    }
    
    .card-overlay {
        padding: 12px;
    }
    
    .card-title {
        font-size: 1em;
    }
    
    .card-fairy {
        font-size: 0.8em;
    }
    
    .card-back-content {
        padding: 15px;
    }
    
    .wish-section,
    .blessing-section,
    .category-section,
    .energy-section {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .image-wish-card {
        width: 98vw;
        max-width: 320px;
        height: 80vh;
        max-height: 500px;
    }
    
    .card-overlay {
        padding: 10px;
    }
    
    .card-number,
    .card-level {
        padding: 4px 8px;
        font-size: 0.7em;
    }
    
    .card-title {
        font-size: 0.9em;
    }
    
    .card-fairy {
        font-size: 0.7em;
    }
    
    .card-back-content {
        padding: 12px;
    }
    
    .fairy-avatar {
        font-size: 1.5em;
    }
    
    .image-card-loading .loading-text {
        font-size: 1em;
    }
    
    .image-card-loading .loading-progress {
        width: 250px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-overlay {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.8) 0%,
            transparent 30%,
            transparent 70%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }
    
    .card-number,
    .card-level {
        border-width: 2px;
    }
    
    .wish-section,
    .category-section,
    .energy-section {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .image-wish-card,
    .image-card-inner,
    .energy-fill,
    .progress-fill {
        transition: none;
    }
    
    .image-wish-card.card-appear {
        animation: none;
    }
    
    .image-card-loading .spinner-ring {
        animation: none;
    }
}
