/* Mario Coloring Pages - Custom Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Orbitron:wght@400;700;900&display=swap');

/* Root Variables */
:root {
    --mario-red: #E60012;
    --mario-blue: #0066CC;
    --mario-yellow: #FFD700;
    --mario-green: #00B04F;
    --mario-orange: #FF6B35;
    --mario-purple: #8B5CF6;
    --mario-brown: #8B4513;
    --mario-pink: #FF69B4;
    --mario-light-blue: #87CEEB;
    --mario-dark-red: #CC0011;
    --mario-dark-blue: #004499;
    --mario-dark-green: #008040;
}

/* Base Styles */
body {
    font-family: 'Comic Neue', cursive, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #e3f2fd 0%, #fff9c4 100%);
    min-height: 100vh;
}

/* Typography */
.font-mario {
    font-family: 'Comic Neue', cursive, sans-serif;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.font-gaming {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

/* Header Enhancements */
header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--mario-yellow);
}

.header-logo {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Hero Section Animations */
.hero-floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Custom Buttons */
.btn-mario {
    background: linear-gradient(45deg, var(--mario-red), var(--mario-dark-red));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.3);
}

.btn-mario:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 0, 18, 0.4);
}

.btn-luigi {
    background: linear-gradient(45deg, var(--mario-green), var(--mario-dark-green));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 176, 79, 0.3);
}

.btn-luigi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 176, 79, 0.4);
}

.btn-peach {
    background: linear-gradient(45deg, var(--mario-pink), #ff1493);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.btn-peach:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

/* Gallery Card Enhancements */
.gallery-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover::before {
    opacity: 1;
}

/* Add a transition to the image itself for a smooth opacity change on load */
.gallery-card img {
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

.gallery-card img[style*="opacity: 1"] {
    opacity: 1;
}

/* Loading spinner animation */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner div {
    animation: spin 1s linear infinite;
    border-top-color: var(--mario-blue);
    border-right-color: var(--mario-green);
    border-bottom-color: var(--mario-yellow);
    border-left-color: var(--mario-red);
}

/* Image error state styling */
.image-error-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(230, 0, 18, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    backdrop-filter: blur(2px);
}

/* Filter buttons styling */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover:not(.active) {
    background-color: var(--mario-light-blue);
    color: var(--mario-dark-blue);
}

/* Character Badge Styles */
.character-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.character-badge.mario {
    background: var(--mario-red);
    color: white;
}

.character-badge.luigi {
    background: var(--mario-green);
    color: white;
}

.character-badge.peach {
    background: var(--mario-pink);
    color: white;
}

.character-badge.bowser {
    background: var(--mario-orange);
    color: white;
}

.character-badge.yoshi {
    background: var(--mario-light-blue);
    color: var(--mario-dark-blue);
}

/* Pricing Cards */
.pricing-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.popular {
    transform: scale(1.05);
    border: 3px solid var(--mario-red);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

/* Feature Cards */
.feature-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card.mario-theme {
    background: linear-gradient(135deg, var(--mario-red) 0%, var(--mario-dark-red) 100%);
}

.feature-card.luigi-theme {
    background: linear-gradient(135deg, var(--mario-green) 0%, var(--mario-dark-green) 100%);
}

.feature-card.peach-theme {
    background: linear-gradient(135deg, var(--mario-pink) 0%, #ff1493 100%);
}

.feature-card.bowser-theme {
    background: linear-gradient(135deg, var(--mario-orange) 0%, #ff4500 100%);
}

.feature-card.yoshi-theme {
    background: linear-gradient(135deg, var(--mario-light-blue) 0%, var(--mario-blue) 100%);
}

/* Testimonial Cards */
.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 60px;
    color: var(--mario-yellow);
    font-weight: bold;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* FAQ Enhancements */
.faq-item {
    background: white;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.faq-question {
    position: relative;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(45deg, var(--mario-red), var(--mario-blue));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.faq-question:hover::after {
    transform: scaleX(1);
}

/* Footer Enhancements */
footer {
    background: linear-gradient(135deg, var(--mario-red) 0%, var(--mario-blue) 100%);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>');
    opacity: 0.5;
}

/* Language Selector */
.language-selector {
    background: var(--mario-yellow);
    color: var(--mario-red);
    border: 2px solid var(--mario-red);
    border-radius: 25px;
    padding: 5px 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector:hover {
    background: var(--mario-red);
    color: var(--mario-yellow);
    transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem !important;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .pricing-card.popular {
        transform: none;
        margin-top: 20px;
    }
    
    .testimonial-card {
        padding: 20px;
    }
    
    .gallery-card {
        margin-bottom: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--mario-yellow);
    border-radius: 50%;
    border-top-color: var(--mario-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--mario-red), var(--mario-blue));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--mario-blue), var(--mario-red));
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .gallery-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus,
a:focus,
input:focus,
select:focus {
    outline: 2px solid var(--mario-yellow);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .feature-card {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff !important;
    }
    
    .gallery-card {
        border: 2px solid #000 !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #fff;
    }
    
    .gallery-card {
        background: #2d2d2d;
        color: #fff;
    }
    
    .testimonial-card {
        background: #2d2d2d;
        color: #fff;
    }
    
    .faq-item {
        background: #2d2d2d;
        color: #fff;
    }
    
    .pricing-card {
        background: #2d2d2d;
        color: #fff;
    }
} 

/* CDN 和图片加载优化样式 */

/* 图片淡入效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 图片加载状态 */
.image-loading {
    position: relative;
    overflow: hidden;
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 图片预加载优化 */
.preload-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(230, 0, 18, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.preload-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* CDN 状态指示器 */
.cdn-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 11px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cdn-status.show {
    opacity: 1;
}

.cdn-status.success {
    background: rgba(0, 176, 79, 0.9);
}

.cdn-status.error {
    background: rgba(220, 38, 127, 0.9);
}

/* 模态框图片加载优化 */
#modal-image {
    transition: opacity 0.3s ease;
    max-height: 70vh;
    object-fit: contain;
}

/* 响应式图片优化 */
@media (max-width: 768px) {
    .aspect-square {
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 769px) {
    .aspect-square {
        aspect-ratio: 4 / 3;
    }
}

/* 懒加载图片样式 */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* 图片错误状态 */
.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
}

/* 性能优化：减少重绘 */
.gallery-item {
    will-change: transform;
    backface-visibility: hidden;
}

.gallery-item:hover {
    will-change: auto;
}

/* CDN 配置显示 */
.cdn-config-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 24px;
    max-width: 500px;
    width: 90vw;
    z-index: 10000;
    display: none;
}

.cdn-config-panel.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 优化选择器性能 */
.gallery-grid {
    contain: layout style;
}

.gallery-item {
    contain: layout style paint;
} 