/* ============================================================
   Sanremo in Residenza 2026 - Stili Frontend
   ============================================================ */

/* Container principale */
#sanremo-videos-container {
    max-width: 100%;
    margin: 30px 0;
}

/* Messaggio di stato votazione */
.sanremo-status-msg {
    text-align: center;
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.5;
}

.sanremo-status-msg.voted {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.sanremo-status-msg.closed {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.sanremo-status-msg.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* Griglia video */
.sanremo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

@media (max-width: 768px) {
    .sanremo-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Singola card video */
.sanremo-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sanremo-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.sanremo-card.voted-card {
    border: 3px solid #1a3a5c;
    box-shadow: 0 4px 20px rgba(26, 58, 92, 0.2);
}

/* Video embed wrapper (16:9) */
.sanremo-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.sanremo-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Thumbnail con play button (lazy load) */
.sanremo-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sanremo-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    pointer-events: none;
}

.sanremo-video-wrapper:hover .sanremo-play-btn {
    background: #c4302b;
}

.sanremo-play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}

/* Info card */
.sanremo-card-info {
    padding: 16px 20px;
}

.sanremo-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.sanremo-card-residence {
    font-size: 14px;
    color: #666;
    margin: 0 0 4px 0;
}

.sanremo-card-performers {
    font-size: 13px;
    color: #999;
    margin: 0;
    font-style: italic;
}

/* Sezione voto */
.sanremo-card-vote {
    padding: 12px 20px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsante voto */
.sanremo-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.sanremo-vote-btn:hover {
    background: #2a5a8c;
    transform: scale(1.05);
}

.sanremo-vote-btn:active {
    transform: scale(0.98);
}

.sanremo-vote-btn:disabled {
    cursor: default;
    transform: none;
}

.sanremo-vote-btn.already-voted {
    background: #e0e0e0;
    color: #999;
    cursor: default;
}

.sanremo-vote-btn.this-voted {
    background: #27ae60;
    color: #fff;
    cursor: default;
}

.sanremo-vote-btn.this-voted:hover {
    background: #27ae60;
    transform: none;
}

/* Icona pollice su (SVG inline) */
.sanremo-vote-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Badge "hai votato" */
.sanremo-voted-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

/* Conteggio voti (quando visibile) */
.sanremo-vote-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #1a3a5c;
    margin-left: 12px;
}

/* Messaggio di conferma modale */
.sanremo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: sanremoFadeIn 0.2s ease;
}

.sanremo-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: sanremoSlideIn 0.3s ease;
}

.sanremo-modal h3 {
    font-size: 20px;
    color: #1a3a5c;
    margin-bottom: 12px;
}

.sanremo-modal p {
    color: #666;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.sanremo-modal .warn {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

.sanremo-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sanremo-modal-actions button {
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sanremo-modal-confirm {
    background: #1a3a5c;
    color: #fff;
}

.sanremo-modal-confirm:hover {
    background: #2a5a8c;
}

.sanremo-modal-cancel {
    background: #f0f0f0;
    color: #666;
}

.sanremo-modal-cancel:hover {
    background: #e0e0e0;
}

/* Animazioni */
@keyframes sanremoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sanremoSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Loading */
.sanremo-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.sanremo-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a3a5c;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: sanremoSpin 0.8s linear infinite;
}

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

/* Error */
.sanremo-error {
    text-align: center;
    padding: 40px 20px;
    color: #c0392b;
    background: #fce4e4;
    border-radius: 8px;
    font-size: 15px;
}

/* Toast notification */
.sanremo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a3a5c;
    color: #fff;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.sanremo-toast.show {
    transform: translateX(-50%) translateY(0);
}

.sanremo-toast.success {
    background: #27ae60;
}

.sanremo-toast.error {
    background: #c0392b;
}

/* ============================================================
   SANREMO IN RESIDENZA 2026 — Sezione Vincitore
   Aggiungi questo CSS in fondo a sanremo.css
   ============================================================ */

/* Titolo "And the winner is..." */
.sanremo-winner-announce {
    text-align: center;
    padding: 30px 20px 10px;
}
.sanremo-winner-intro {
    font-size: 2em;
    font-weight: 700;
    color: #1a3a5c;
    font-style: italic;
    margin: 0;
    letter-spacing: 0.02em;
    animation: sanremo-fadeInUp 1s ease-out;
}

/* Sezione vincitore: due colonne */
.sanremo-winner-section {
    display: flex;
    gap: 30px;
    align-items: center;
    max-width: 900px;
    margin: 20px auto 40px;
    padding: 25px;
    background: linear-gradient(135deg, #fffef5 0%, #fff9e6 100%);
    border: 2px solid #FFD700;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
    animation: sanremo-fadeInUp 1.2s ease-out;
}

/* Colonna video */
.sanremo-winner-video {
    flex: 1;
    min-width: 0;
}
.sanremo-winner-video .sanremo-video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Colonna info con coppa */
.sanremo-winner-info {
    flex: 0 0 280px;
    text-align: center;
    padding: 10px;
}

/* Coppa d'oro */
.sanremo-trophy {
    margin-bottom: 15px;
}
.sanremo-trophy-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.5));
    animation: sanremo-bounce 2s ease-in-out infinite;
}

/* Info vincitore */
.sanremo-winner-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 6px;
    line-height: 1.3;
}
.sanremo-winner-residence {
    font-size: 1em;
    color: #555;
    margin: 0 0 4px;
}
.sanremo-winner-performers {
    font-size: 0.9em;
    color: #888;
    font-style: italic;
    margin: 0 0 15px;
}
.sanremo-winner-votes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a3a5c;
    color: #fff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
}
.sanremo-winner-votes .sanremo-vote-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Separatore "La classifica" */
.sanremo-results-divider {
    text-align: center;
    margin: 30px 0 25px;
    position: relative;
}
.sanremo-results-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}
.sanremo-results-divider span {
    position: relative;
    background: #f5f5f5; /* adatta al colore di sfondo della tua pagina */
    padding: 0 20px;
    font-size: 1.1em;
    font-weight: 600;
    color: #1a3a5c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Animazioni */
@keyframes sanremo-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes sanremo-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Responsive: su mobile le colonne diventano verticali */
@media (max-width: 640px) {
    .sanremo-winner-section {
        flex-direction: column;
        padding: 20px 15px;
        gap: 20px;
    }
    .sanremo-winner-info {
        flex: none;
        width: 100%;
    }
    .sanremo-winner-intro {
        font-size: 1.5em;
    }
    .sanremo-trophy-icon {
        width: 60px;
        height: 60px;
    }
    .sanremo-winner-title {
        font-size: 1.2em;
    }
}
