/* Marvel Champions - Card Hover and Preview Effects */

/* Base card hover styles */
.card-component {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-component:hover {
    transform: translateY(-10px) scale(1.05);
    z-index: 100;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.2);
}

/* Card preview on hover - desktop only */
@media (hover: hover) and (min-width: 768px) {
    .card-component::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        width: 300px;
        height: 420px;
        background: inherit;
        background-size: cover;
        border-radius: 12px;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 1000;
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.8),
            0 0 30px rgba(255, 215, 0, 0.4);
    }
    
    .card-component:hover::after {
        transform: translate(-50%, -50%) scale(3);
        opacity: 1;
    }
}

/* Floating preview panel */
.card-preview-panel {
    position: fixed;
    width: 350px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    z-index: 10000;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
    pointer-events: none;
}

.card-preview-panel.visible {
    opacity: 1;
    transform: scale(1);
}

.card-preview-panel .card-image {
    width: 100%;
    height: 420px;
    border-radius: 10px;
    margin-bottom: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.card-preview-panel .card-details {
    color: white;
}

.card-preview-panel .card-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.card-preview-panel .card-type {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-preview-panel .card-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #e0e0e0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border-left: 3px solid #ffd700;
}

.card-preview-panel .card-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.card-preview-panel .stat {
    text-align: center;
}

.card-preview-panel .stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

.card-preview-panel .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
}

/* Glow effects for different card types */
.card-component.hero-card:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(76, 175, 80, 0.6);
}

.card-component.villain-card:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(244, 67, 54, 0.6);
}

.card-component.aspect-aggression:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(239, 83, 80, 0.6);
}

.card-component.aspect-justice:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 235, 59, 0.6);
}

.card-component.aspect-leadership:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(33, 150, 243, 0.6);
}

.card-component.aspect-protection:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(76, 175, 80, 0.6);
}

/* Quick zoom on hold */
.card-component.zooming {
    position: fixed !important;
    z-index: 9999 !important;
    transform: scale(3) !important;
    transition: transform 0.2s ease !important;
}

/* Highlight for selectable cards */
.card-component.selectable {
    cursor: pointer;
    position: relative;
}

.card-component.selectable::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 215, 0, 0.3) 50%, 
        transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 2s infinite;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-component.selectable:hover::before {
    opacity: 1;
}

/* Selected card effect */
.card-component.selected {
    transform: translateY(-15px) scale(1.1);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.8),
        inset 0 0 20px rgba(255, 215, 0, 0.3);
    z-index: 101;
}

.card-component.selected::before {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Targeting mode highlight */
.card-component.targetable {
    animation: pulse-target 1.5s infinite;
}

@keyframes pulse-target {
    0%, 100% {
        box-shadow: 
            0 10px 20px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(255, 0, 0, 0.4);
    }
    50% {
        box-shadow: 
            0 10px 20px rgba(0, 0, 0, 0.3),
            0 0 40px rgba(255, 0, 0, 0.8);
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* Disable hover on touch devices */
@media (hover: none) {
    .card-component:hover {
        transform: none;
    }
    
    .card-component::after {
        display: none;
    }
    
    /* Tap to preview on mobile */
    .card-component:active {
        transform: scale(0.95);
    }
}