/* Animated Theme Previews with Interactive Effects */
/* Enhanced visual system for theme selection interface */

/* Main theme preview container with enhanced styling */
.theme-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Individual theme preview cards with animations */
.theme-preview-card {
    position: relative;
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: cardFloat 6s ease-in-out infinite;
}

/* Floating animation for preview cards */
@keyframes cardFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% { 
        transform: translateY(-3px) rotate(0.5deg);
    }
    50% { 
        transform: translateY(-1px) rotate(0deg);
    }
    75% { 
        transform: translateY(-2px) rotate(-0.3deg);
    }
}

/* Hover effects for theme cards */
.theme-preview-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation-play-state: paused;
}

/* Active theme selection styling */
.theme-preview-card.active {
    transform: scale(1.05);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(99, 102, 241, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Shimmer effect for preview cards */
.theme-preview-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shimmerPreview 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerPreview {
    0%, 100% { 
        transform: translateX(-150%) translateY(-150%) rotate(45deg);
        opacity: 0;
    }
    50% { 
        transform: translateX(50%) translateY(50%) rotate(45deg);
        opacity: 0.8;
    }
}

/* Theme-specific background gradients for previews */
.theme-preview-peace-calm {
    background: linear-gradient(135deg, 
        rgba(30, 27, 75, 0.9) 0%, 
        rgba(49, 46, 129, 0.8) 25%, 
        rgba(99, 102, 241, 0.6) 50%, 
        rgba(30, 27, 75, 0.9) 100%);
}

.theme-preview-ocean-breeze {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.9) 0%, 
        rgba(30, 41, 59, 0.8) 25%, 
        rgba(14, 165, 233, 0.6) 50%, 
        rgba(15, 23, 42, 0.9) 100%);
}

.theme-preview-sunset-glow {
    background: linear-gradient(135deg, 
        rgba(28, 25, 23, 0.9) 0%, 
        rgba(41, 37, 36, 0.8) 25%, 
        rgba(249, 115, 22, 0.6) 50%, 
        rgba(28, 25, 23, 0.9) 100%);
}

.theme-preview-forest-zen {
    background: linear-gradient(135deg, 
        rgba(20, 83, 45, 0.9) 0%, 
        rgba(22, 101, 52, 0.8) 25%, 
        rgba(16, 185, 129, 0.6) 50%, 
        rgba(20, 83, 45, 0.9) 100%);
}

.theme-preview-midnight-focus {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.9) 0%, 
        rgba(30, 41, 59, 0.8) 25%, 
        rgba(59, 130, 246, 0.6) 50%, 
        rgba(15, 23, 42, 0.9) 100%);
}

.theme-preview-sakura-dreams {
    background: linear-gradient(135deg, 
        rgba(30, 27, 75, 0.9) 0%, 
        rgba(49, 46, 129, 0.8) 25%, 
        rgba(236, 72, 153, 0.6) 50%, 
        rgba(30, 27, 75, 0.9) 100%);
}

.theme-preview-coral-reef {
    background: linear-gradient(135deg, 
        rgba(12, 74, 110, 0.9) 0%, 
        rgba(8, 145, 178, 0.8) 25%, 
        rgba(249, 115, 22, 0.6) 50%, 
        rgba(12, 74, 110, 0.9) 100%);
}

.theme-preview-cosmic-purple {
    background: linear-gradient(135deg, 
        rgba(88, 28, 135, 0.9) 0%, 
        rgba(124, 58, 237, 0.8) 25%, 
        rgba(192, 132, 252, 0.6) 50%, 
        rgba(88, 28, 135, 0.9) 100%);
}

.theme-preview-golden-hour {
    background: linear-gradient(135deg, 
        rgba(120, 53, 15, 0.9) 0%, 
        rgba(217, 119, 6, 0.8) 25%, 
        rgba(251, 191, 36, 0.6) 50%, 
        rgba(120, 53, 15, 0.9) 100%);
}

.theme-preview-emerald-city {
    background: linear-gradient(135deg, 
        rgba(6, 95, 70, 0.9) 0%, 
        rgba(16, 185, 129, 0.8) 25%, 
        rgba(110, 231, 183, 0.6) 50%, 
        rgba(6, 95, 70, 0.9) 100%);
}

.theme-preview-neon-nights {
    background: linear-gradient(135deg, 
        rgba(20, 20, 20, 0.9) 0%, 
        rgba(168, 85, 247, 0.8) 25%, 
        rgba(236, 72, 153, 0.6) 50%, 
        rgba(20, 20, 20, 0.9) 100%);
}

.theme-preview-royal-blue {
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.9) 0%, 
        rgba(59, 130, 246, 0.8) 25%, 
        rgba(96, 165, 250, 0.6) 50%, 
        rgba(30, 58, 138, 0.9) 100%);
}

/* Theme preview content styling */
.theme-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.theme-preview-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-preview-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.8);
}

.theme-preview-description {
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Interactive elements within previews */
.theme-preview-elements {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.preview-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulseGlow 3s ease-in-out infinite;
}

.preview-dot:nth-child(1) {
    background: rgba(255, 255, 255, 0.8);
    animation-delay: 0s;
}

.preview-dot:nth-child(2) {
    background: rgba(255, 255, 255, 0.6);
    animation-delay: 0.5s;
}

.preview-dot:nth-child(3) {
    background: rgba(255, 255, 255, 0.4);
    animation-delay: 1s;
}

@keyframes pulseGlow {
    0%, 100% { 
        opacity: 0.4;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Selection indicator */
.theme-preview-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-preview-card.active::after {
    opacity: 1;
    transform: scale(1);
}

/* Ripple effect on click */
.theme-preview-card {
    position: relative;
    overflow: hidden;
}

.theme-preview-card .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-preview-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .theme-preview-card {
        min-height: 160px;
        padding: 20px;
    }
    
    .theme-preview-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    /* Reduce animation intensity on mobile */
    .theme-preview-card::before {
        animation-duration: 4s;
    }
    
    @keyframes cardFloat {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-2px); }
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .theme-preview-card,
    .theme-preview-card::before,
    .preview-dot {
        animation: none !important;
    }
    
    .theme-preview-card:hover {
        transform: none;
    }
}

/* Theme selector modal enhancements */
.theme-selector-modal {
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.7);
}

.theme-selector-content {
    background: 
        linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.theme-selector-header {
    text-align: center;
    margin-bottom: 32px;
}

.theme-selector-title {
    font-size: 2rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-selector-subtitle {
    color: #cbd5e1;
    font-size: 1.1rem;
}