/* Biscorotti Poll Styles */

.biscorotti-poll-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--wp--preset--color--accent-3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /*font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;*/
}

/* Stili per domanda */
.poll-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* Stili per i pulsanti */
.poll-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.poll-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.poll-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.poll-btn:hover::before {
    left: 100%;
}

.poll-yes {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.poll-yes:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.poll-no {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.poll-no:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.poll-btn:active {
    transform: translateY(0);
}

.poll-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.poll-loading {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    margin: 1rem 0;
}

/* Risultati - Nuovo Design Moderno */
.poll-results {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
    width: 100%;
}

.result-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100%;
}

.result-circle {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 1rem;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--progress-color) 0deg var(--progress-angle),
        #d8b226 var(--progress-angle) 360deg
    );
    transition: all 0.8s ease-out;
}

.result-circle::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: var(--wp--preset--color--accent-3);
    border-radius: 50%;
    z-index: 1;
}

.result-label {
    font-weight: 700;
    font-size: 3.1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    z-index: 2;
    position: relative;
}

.result-percentage {
    font-weight: 800;
    font-size: 5.8rem;
    color: var(--progress-color);
    z-index: 2;
    position: relative;
    transition: all 0.3s ease;
}

/* Colori specifici per SI e NO */
.result-item.yes .result-circle {
    --progress-color: #27ae60;
}

.result-item.no .result-circle {
    --progress-color: #e74c3c;
}

/* Forza layout a colonne per risultati dinamici */
.poll-results:has(.result-item) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
}

/* Assicura che i risultati siano sempre visibili quando generati dal PHP */
.poll-results.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Animazioni per JavaScript vanilla */
.poll-btn.voting {
    transform: scale(0.95);
    opacity: 0.8;
}

.biscorotti-poll-container.voted-success {
    animation: successPulse 0.5s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Animazione countup */
@keyframes countup {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-percentage.counting {
    animation: countup 0.5s ease-out;
}

/* Transizioni per fade in/out */
.poll-loading,
.poll-message,
.poll-results {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-buttons {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animazione di entrata per i risultati */
.poll-results {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-results.show {
    opacity: 1;
    transform: translateY(0);
}

/* Messaggio dopo il voto */
.poll-message {
    color: #2c3e50;
    text-align: center;
    font-weight: 600;
    font-size: 1.8rem;
    margin-top: 1rem;
    padding: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-message.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Stili per stile classico */
.style-classic .biscorotti-poll-container {
    border: 2px solid #ddd;
    box-shadow: none;
    border-radius: 4px;
}

.style-classic .poll-question {
    font-size: 2.2rem;
}

.style-classic .poll-btn {
    border-radius: 4px;
    background: #007cba;
    color: white;
}

.style-classic .poll-btn:hover {
    background: #005a87;
    transform: none;
    box-shadow: none;
}

/* Stili per stile minimal */
.style-minimal .biscorotti-poll-container {
    background: transparent;
    box-shadow: none;
    padding: 1rem;
}

.style-minimal .poll-question {
    font-size: 2.2rem;
    color: #666;
}

.style-minimal .poll-btn {
    background: transparent;
    border: 2px solid #ddd;
    color: #666;
    border-radius: 4px;
}

.style-minimal .poll-btn:hover {
    border-color: #007cba;
    color: #007cba;
    transform: none;
    box-shadow: none;
}

.style-minimal .poll-results {
    background: transparent;
    border: 1px solid #eee;
}

/* Responsive design */
@media (max-width: 768px) {
    .biscorotti-poll-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .poll-question {
        font-size: 1.3rem;
    }
    
    .poll-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .poll-btn {
        width: 100%;
        min-width: auto;
    }
    
    .poll-results {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    

    
    .result-percentage {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .biscorotti-poll-container {
        padding: 1rem;
    }
    
    .poll-question {
        font-size: 1.1rem;
    }
    
    .poll-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    

    
    .result-percentage {
        font-size: 1.3rem;
    }
}



.poll-results {
    animation: fadeIn 0.3s ease-out;
}

/* Focus states per accessibilità */
.poll-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .biscorotti-poll-container {
        border: 2px solid #000;
    }
    
    .poll-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .poll-btn,
    .biscorotti-poll-container,
    .poll-results,
    .result-circle,
    .result-percentage {
        animation: none;
        transition: none;
    }
    
    .poll-btn:hover {
        transform: none;
    }
}
