/* Card Enhancements - Logos, Banners, and Promoted Cards */

/* Promoted Card Styling */
.promoted-card {
    position: relative;
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(123, 47, 247, 0.05) 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: promotedGlow 3s ease-in-out infinite;
}

@keyframes promotedGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.5), 0 0 60px rgba(123, 47, 247, 0.3);
    }
}

/* Promoted Badge */
.promoted-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    padding: 8px 20px;
    border-radius: 0 15px 0 20px;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: promotedBadgeShine 3s ease-in-out infinite;
}

.promoted-badge i {
    font-size: 14px;
    animation: crownRotate 4s ease-in-out infinite;
}

@keyframes promotedBadgeShine {
    0%, 100% {
        background: linear-gradient(135deg, #ffd700, #ffed4e);
    }
    50% {
        background: linear-gradient(135deg, #ffed4e, #fff59d);
    }
}

@keyframes crownRotate {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Promo Banner */
.promo-banner {
    width: calc(100% + 40px);
    height: 120px;
    overflow: hidden;
    border-radius: 12px;
    margin: 20px -20px;
    position: relative;
    background: linear-gradient(135deg, #7b2ff7, #b8b8c8);
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.2);
}

.promo-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.site-card:hover .promo-banner img {
    transform: scale(1.05);
}

/* Site Logo */
.site-logo {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.1);
    transition: transform 0.3s ease;
}

.site-card:hover .site-logo img {
    transform: scale(1.1);
}

/* Adjust card header for logo */
.site-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.site-card .card-header .site-name {
    flex: 1;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* When logo is present, adjust layout */
.site-card .card-header:has(.site-logo) {
    display: flex;
    align-items: center;
}

.site-card .card-header:has(.site-logo) .site-name {
    margin-right: auto;
}

/* Trust score positioning when logo is present */
.site-card .card-header:has(.site-logo) .trust-score {
    margin-left: auto;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .promoted-badge {
        padding: 6px 15px;
        font-size: 11px;
    }
    
    .promo-banner {
        height: 120px;
    }
    
    .site-logo {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    
    .site-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .site-card .card-header:has(.site-logo) {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .site-card .card-header:has(.site-logo) .trust-score {
        width: 100%;
        margin-top: 10px;
    }
}

/* Loading state for images */
.site-logo img,
.promo-banner img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-logo img[src],
.promo-banner img[src] {
    opacity: 1;
}

/* Error state for broken images */
.site-logo img:not([src]),
.site-logo img[src=""],
.promo-banner img:not([src]),
.promo-banner img[src=""] {
    display: none;
}

.site-logo:has(img:not([src])),
.site-logo:has(img[src=""]) {
    display: none;
}

.promo-banner:has(img:not([src])),
.promo-banner:has(img[src=""]) {
    display: none;
}

/* Animation for promoted cards entering view */
.promoted-card.animate-fadeInUp {
    animation: promotedFadeInUp 0.6s ease forwards, promotedGlow 3s ease-in-out infinite 0.6s;
}

@keyframes promotedFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced hover effect for promoted cards */
.promoted-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4), 0 0 60px rgba(123, 47, 247, 0.3);
}

/* Z-index management for promoted cards */
.promoted-card {
    z-index: 2;
}

.site-card:not(.promoted-card) {
    z-index: 1;
}
