/**
 * TOP FIVE INTERACTIVE - CYBERPUNK 2025 EDITION
 * 
 * Color Palette:
 * --tf-bg: #0C0B12 (deep black)
 * --tf-card: #15141F (card background)
 * --tf-cyan: #00f2ff (neon cyan)
 * --tf-magenta: #ff00c8 (neon magenta)
 * --tf-gold: #FFCB44 (accent gold)
 */

:root {
    --tf-bg: #0C0B12;
    --tf-card: #15141F;
    --tf-card-border: rgba(255, 255, 255, 0.08);
    --tf-cyan: #00f2ff;
    --tf-magenta: #ff00c8;
    --tf-gold: #FFCB44;
    --tf-text: #E0E0E0;
    --tf-text-muted: #8E8E9A;
    --tf-glass: rgba(30, 29, 35, 0.65);
}

/* ========================================
   SECTION CONTAINER
   ======================================== */
.top-five-interactive {
    padding: 80px 0 100px;
    background: var(--tf-bg);
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    z-index: 50;
}

.top-five-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 100vw);
    height: 800px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
    overflow: hidden;
}

.top-five-interactive .section-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    text-align: center;
    color: #fff;
    margin-bottom: 60px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        0 0 20px rgba(0, 242, 255, 0.5),
        0 0 40px rgba(0, 242, 255, 0.3);
    position: relative;
}

.top-five-interactive .section-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, var(--tf-cyan), var(--tf-magenta));
    margin: 20px auto 0;
    border-radius: 3px;
}

.top-five-interactive .section-disclosure {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 15px;
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ========================================
   CARDS GRID
   ======================================== */
.tf-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 100; /* Above background overlays */
}

@media (max-width: 1200px) {
    .tf-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tf-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
}

/* ========================================
   SINGLE CARD
   ======================================== */
.tf-card {
    position: relative;
    background: var(--tf-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--tf-card-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Glassmorphism overlay */
.tf-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 1;
    border-radius: 16px;
}

/* Glow effect */
.tf-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        45deg,
        var(--tf-cyan),
        var(--tf-magenta),
        var(--tf-cyan)
    );
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    filter: blur(15px);
    transition: opacity 0.4s ease;
}

.tf-card:hover .tf-glow {
    opacity: 0.6;
}

/* Hover: tilt + scale */
.tf-card:hover {
    transform: translateY(-10px) rotateX(3deg) rotateY(-2deg) scale(1.02);
    border-color: rgba(0, 242, 255, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 242, 255, 0.2);
}

/* ========================================
   HOT BADGE
   ======================================== */
.tf-hot-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff4444 0%, #ff0066 100%);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 102, 0.5);
    animation: pulse-hot 2s ease-in-out infinite;
}

.tf-hot-icon {
    font-size: 12px;
    animation: flame 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-hot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes flame {
    from { transform: translateY(0) rotate(-5deg); }
    to { transform: translateY(-2px) rotate(5deg); }
}

/* ========================================
   RANK BADGE
   ======================================== */
.tf-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: baseline;
    padding: 8px 14px;
    background: var(--tf-glass);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tf-rank-hash {
    font-size: 14px;
    font-weight: 700;
    color: var(--tf-cyan);
    margin-right: 2px;
}

.tf-rank-num {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px var(--tf-cyan);
    line-height: 1;
}

/* ========================================
   IMAGE CONTAINER
   ======================================== */
.tf-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.tf-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tf-card:hover .tf-image {
    transform: scale(1.1);
}

/* Gradient overlay on image - RIMOSSO */

/* Hover overlay */
.tf-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.tf-card:hover .tf-overlay,
.tf-card.mobile-active .tf-overlay {
    opacity: 1;
}

/* Mobile active state */
.tf-card.mobile-active .tf-visit-btn {
    transform: translateY(0);
    opacity: 1;
}

.tf-visit-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--tf-cyan) 0%, var(--tf-magenta) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    text-decoration: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.4);
}

.tf-card:hover .tf-visit-btn {
    transform: translateY(0);
    opacity: 1;
}

.tf-visit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 242, 255, 0.6);
    color: #fff;
}

/* ========================================
   CONTENT AREA
   ======================================== */
.tf-content {
    padding: 18px 16px 20px;
    position: relative;
    z-index: 10;
}

.tf-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}

.tf-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-title a:hover {
    color: var(--tf-cyan);
}

/* NASCONDE la label statica (★★★★★) */
.tf-label {
    display: none !important;
}

/* ========================================
   RATING STARS
   ======================================== */
.tf-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    position: relative;
    z-index: 20;
}

.tf-stars {
    display: flex;
    gap: 2px;
}

.tf-star {
    font-size: 16px;
    color: #3a3a4a;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tf-star.active {
    color: var(--tf-gold);
    text-shadow: 0 0 10px var(--tf-gold);
}

.tf-star:hover,
.tf-star.hover {
    color: var(--tf-gold);
    transform: scale(1.2);
}

.tf-star.selected {
    animation: star-pop 0.4s ease;
}

@keyframes star-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.tf-rating-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--tf-gold);
}

.tf-rating-count {
    font-size: 12px;
    color: var(--tf-text-muted);
}

/* Disabled state after voting */
.tf-rating.voted .tf-star {
    cursor: default;
    pointer-events: none;
}

.tf-rating.voted::after {
    content: '✓';
    font-size: 10px;
    color: var(--tf-cyan);
    margin-left: 4px;
}

/* ========================================
   LIKE BUTTON
   ======================================== */
.tf-actions {
    display: flex;
    justify-content: flex-start;
}

.tf-like-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--tf-text-muted);
    position: relative;
    z-index: 20;
}

.tf-like-btn:hover {
    border-color: var(--tf-magenta);
    background: rgba(255, 0, 200, 0.1);
    color: var(--tf-magenta);
}

.tf-like-btn.liked {
    border-color: var(--tf-magenta);
    background: linear-gradient(135deg, rgba(255, 0, 200, 0.2) 0%, rgba(255, 0, 200, 0.1) 100%);
    color: var(--tf-magenta);
    pointer-events: none;
}

.tf-like-btn.liked .tf-like-icon svg {
    fill: var(--tf-magenta);
    stroke: var(--tf-magenta);
    animation: heart-beat 0.6s ease;
}

@keyframes heart-beat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tf-like-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-like-icon svg {
    transition: all 0.3s ease;
}

.tf-like-count {
    font-size: 14px;
    font-weight: 700;
    min-width: 30px;
    text-align: left;
}

/* Count animation */
.tf-like-count.counting {
    animation: count-up 0.5s ease;
}

@keyframes count-up {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-10px); opacity: 0; }
    51% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ========================================
   CONFETTI CANVAS
   ======================================== */
.tf-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
}

/* ========================================
   LOADING STATE
   ======================================== */
.tf-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tf-card.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 100;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */
@media (max-width: 768px) {
    .top-five-interactive {
        padding: 50px 0 70px;
    }
    
    .top-five-interactive .section-title {
        margin-bottom: 20px;
        padding: 0 15px;
    }
    
    .top-five-interactive .section-disclosure {
        font-size: 11px;
        margin-top: 10px;
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .tf-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .tf-rank {
        padding: 6px 10px;
    }
    
    .tf-rank-num {
        font-size: 18px;
    }
    
    .tf-hot-badge {
        padding: 4px 8px;
        font-size: 8px;
    }
    
    .tf-content {
        padding: 12px 10px 14px;
    }
    
    .tf-title {
        font-size: 13px;
    }
    
    .tf-label {
        font-size: 9px;
        margin-bottom: 8px;
    }
    
    .tf-rating {
        gap: 5px;
        margin-bottom: 10px;
    }
    
    .tf-star {
        font-size: 14px;
    }
    
    .tf-rating-value {
        font-size: 12px;
    }
    
    .tf-rating-count {
        font-size: 10px;
    }
    
    .tf-like-btn {
        padding: 8px 12px;
        gap: 5px;
    }
    
    .tf-like-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .tf-like-count {
        font-size: 12px;
    }
    
    .tf-visit-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ========================================
   ENTRANCE ANIMATIONS
   ======================================== */
.tf-card {
    opacity: 0;
    transform: translateY(40px);
    animation: card-enter 0.6s ease forwards;
}

.tf-card:nth-child(1) { animation-delay: 0.1s; }
.tf-card:nth-child(2) { animation-delay: 0.2s; }
.tf-card:nth-child(3) { animation-delay: 0.3s; }
.tf-card:nth-child(4) { animation-delay: 0.4s; }
.tf-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes card-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   NEON GLOW TEXT EFFECT
   ======================================== */
.tf-card:hover .tf-title a {
    text-shadow: 
        0 0 5px var(--tf-cyan),
        0 0 10px var(--tf-cyan);
}

