/* ===== SONDAGES EN DIRECT ===== */

/* ===== BOUTON FLOTTANT ===== */
.floating-polls-button {
    position: fixed;
    bottom: 330px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s ease;
    animation: pollsPulse 2s ease-in-out infinite;
}

.floating-polls-button:hover {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6);
}

@keyframes pollsPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.7);
    }
}

/* ===== PANNEAU PRINCIPAL ===== */
.polls-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.polls-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.polls-panel {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 26, 0.95));
    border: 2px solid #3b82f6;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.polls-panel-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.polls-panel-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: white;
}

.polls-panel-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.polls-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.polls-panel-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(80vh - 85px);
}

.polls-panel-body::-webkit-scrollbar {
    width: 8px;
}

.polls-panel-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.polls-panel-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 10px;
}

/* ===== ÉTATS ===== */
.polls-loading {
    text-align: center;
    padding: 60px 20px;
}

.polls-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.polls-loading p {
    color: var(--text-gray);
    font-size: 14px;
}

.polls-empty {
    text-align: center;
    padding: 60px 20px;
}

.polls-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.polls-empty h3 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.polls-empty p {
    color: var(--text-gray);
    font-size: 15px;
}

.polls-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
    font-weight: 600;
}

/* ===== LISTE DES SONDAGES ===== */
.polls-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ===== ITEM DE SONDAGE ===== */
.poll-item {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 18px;
    padding: 30px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.poll-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s ease;
}

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

.poll-item:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.poll-item.poll-voted {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Header du sondage */
.poll-header {
    margin-bottom: 25px;
}

.poll-question {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.poll-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
}

.poll-votes-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Container des options */
.poll-options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===== BOUTONS D'OPTIONS (mode vote) ===== */
.poll-option-button {
    width: 100%;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.poll-option-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    opacity: 0.1;
    transition: width 0.4s ease;
}

.poll-option-button:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.poll-option-button:hover::before {
    width: 100%;
}

.poll-option-button:active {
    transform: translateX(8px) scale(0.98);
}

.poll-option-radio {
    font-size: 22px;
    color: #3b82f6;
    transition: transform 0.3s ease;
}

.poll-option-button:hover .poll-option-radio {
    transform: scale(1.2) rotate(360deg);
}

.poll-option-text {
    flex: 1;
}

/* ===== RÉSULTATS ===== */
.poll-result-option {
    position: relative;
    padding: 18px 22px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.poll-result-option:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.poll-result-option.user-voted {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.poll-result-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    opacity: 0.3;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.poll-result-option.user-voted .poll-result-bar {
    background: linear-gradient(90deg, #10b981, #059669);
    opacity: 0.4;
}

.poll-result-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.poll-result-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.vote-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #10b981;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badgePop 0.4s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.poll-result-percentage {
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 60px;
    text-align: right;
}

.poll-result-option.user-voted .poll-result-percentage {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Footer du sondage */
.poll-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.poll-thanks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #10b981;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    animation: thanksFade 0.5s ease;
}

@keyframes thanksFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== WIDGET FLOTTANT (ANCIEN STYLE) ===== */
.poll-widget {
    position: fixed;
    bottom: 250px;
    right: -400px;
    width: 380px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(26, 26, 26, 0.98));
    border: 2px solid var(--gold);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.3);
    z-index: 998;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.poll-widget.active {
    right: 30px;
}

.poll-widget.minimized {
    bottom: 250px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.poll-widget.minimized .poll-body {
    display: none;
}

.poll-widget.minimized .poll-header {
    flex-direction: column;
    justify-content: center;
    padding: 15px;
}

.poll-widget.minimized .poll-title-section {
    display: none;
}

.poll-widget.minimized .poll-icon {
    font-size: 32px;
    margin: 0;
}

/* Header Widget */
.poll-widget .poll-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    padding: 20px;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.poll-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.poll-title-section {
    flex: 1;
}

.poll-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.poll-close {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    color: var(--primary-black);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poll-close:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

/* Body Widget */
.poll-body {
    padding: 20px;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.poll-option {
    background: rgba(212, 175, 55, 0.05);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.poll-option:not(.voted):hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
    transform: translateX(5px);
}

.poll-option.voted {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-color: var(--gold);
    cursor: default;
}

.poll-option.voting {
    animation: voteAnimation 0.6s ease;
}

@keyframes voteAnimation {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

.poll-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
}

.poll-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
}

.poll-option input[type="radio"]:disabled {
    cursor: default;
}

.poll-option label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-white);
    cursor: pointer;
}

.poll-option.voted label {
    cursor: default;
}

.vote-check {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--gold);
    animation: checkAppear 0.3s ease;
}

@keyframes checkAppear {
    0% { opacity: 0; transform: translateY(-50%) scale(0); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

.poll-option-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.poll-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.poll-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--light-gold) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.poll-percentage {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    min-width: 45px;
    text-align: right;
}

.poll-votes {
    font-size: 11px;
    color: var(--text-gray);
    min-width: 60px;
    text-align: right;
}

/* Footer Widget */
.poll-widget .poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.poll-total,
.poll-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 600;
}

.poll-total-icon,
.poll-timer-icon {
    font-size: 16px;
}

.poll-timer {
    color: var(--gold);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .floating-polls-button {
        bottom: 300px;
    }
}

@media (max-width: 768px) {
    .floating-polls-button {
        bottom: 280px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .polls-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .polls-panel-header {
        padding: 20px;
    }
    
    .polls-panel-header h2 {
        font-size: 20px;
    }
    
    .polls-panel-body {
        padding: 20px;
    }
    
    .poll-item {
        padding: 20px;
    }
    
    .poll-question {
        font-size: 18px;
    }
    
    .poll-option-button {
        padding: 15px 18px;
        font-size: 15px;
    }
    
    .poll-result-text {
        font-size: 15px;
    }
    
    .poll-result-percentage {
        font-size: 18px;
    }
    
    /* Widget */
    .poll-widget {
        bottom: 160px;
        right: -100%;
        width: calc(100vw - 40px);
        left: 50%;
        transform: translateX(-50%);
    }

    .poll-widget.active {
        right: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .poll-widget.minimized {
        width: 70px;
        height: 70px;
        left: auto;
        right: 20px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .floating-polls-button {
        bottom: 260px;
    }
    
    .polls-panel-header h2 {
        font-size: 18px;
    }
    
    .poll-question {
        font-size: 16px;
    }
    
    .poll-option-button {
        padding: 14px 16px;
        font-size: 14px;
        gap: 10px;
    }
    
    .poll-result-option {
        padding: 14px 16px;
    }
    
    .poll-result-text {
        font-size: 14px;
    }
    
    .poll-result-percentage {
        font-size: 16px;
    }
    
    .vote-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    /* Widget */
    .poll-widget {
        bottom: 140px;
        width: calc(100vw - 20px);
    }

    .poll-header {
        padding: 15px;
    }

    .poll-body {
        padding: 15px;
    }

    .poll-option {
        padding: 12px;
    }

    .poll-option-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .poll-bar-container {
        width: 100%;
    }

    .poll-widget .poll-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}