/* Poll Display Styles - Polished Modern Design */
.poll-container {
    margin: 0.5rem;
    padding: 2.5rem 2rem;
    background: linear-gradient(145deg, #1a1c1e 0%, #252729 100%);
    border-radius: 18px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(76, 175, 80, 0.1) inset;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    width: calc(100% - 1rem);
}

.poll-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4CAF50, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poll-container::after {
    content: '';
    display: none;
}

.poll-container:hover {
    border-color: rgba(76, 175, 80, 0.35);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.2) inset;
    transform: translateY(-3px);
}

.poll-container:hover::before {
    opacity: 1;
}

.poll-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.75rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    position: relative;
    padding-left: 1rem;
}

.poll-question::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4CAF50, #45a049);
    border-radius: 2px;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.poll-option {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.75rem 1.75rem;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.poll-option:hover {
    border-color: rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.poll-option.voted {
    border-color: rgba(76, 175, 80, 0.5);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.08) 100%);
}

.poll-option.selected {
    border-color: rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.15));
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2), 0 10px 30px rgba(76, 175, 80, 0.3);
    transform: translateX(8px) translateY(-2px);
}

.poll-option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-option-radio {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.poll-option.selected .poll-option-radio {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.2), 0 4px 12px rgba(76, 175, 80, 0.4);
}

.poll-option.selected .poll-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: radioFill 0.3s ease;
}

@keyframes radioFill {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Smooth bar growth and sheen on update */
.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    opacity: 0.15;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
}

.poll-option.vote-updated .poll-option-content {
    transform: translateY(-1px) scale(1.01);
}

.poll-option.vote-updated .poll-option-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
    filter: blur(6px);
    animation: barSheen 0.7s ease forwards;
}

@keyframes barSheen {
    0% {
        transform: translateX(-60%);
        opacity: 0.0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateX(260%);
        opacity: 0;
    }
}

.poll-option-text {
    flex: 1;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.poll-option-votes {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 65px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    opacity: 0.15;
    transition: all 0.3s ease;
    z-index: 1;
    border-radius: 8px;
}

.poll-option.voted .poll-option-bar {
    opacity: 0.2;
}

.poll-option:hover .poll-option-bar {
    opacity: 0.25;
}

.poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.view-voters-btn {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(76, 175, 80, 0.04) 100%);
    border: 2px solid rgba(76, 175, 80, 0.25);
    color: #4CAF50;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.view-voters-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.08) 100%);
    color: #66BB6A;
    border-color: rgba(76, 175, 80, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.25);
}

.view-voters-btn:active {
    transform: translateY(-1px);
}

.voters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.voters-modal {
    width: min(520px, 92vw);
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.voters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}

.voters-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.voters-close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.voters-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
}

.voters-section {
    margin-bottom: 0.75rem;
}

.voters-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 0.25rem;
}

.voters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.voter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
}

.voter-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.voter-item img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.voter-info {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.voter-name {
    color: var(--text-primary);
    font-weight: 600;
}

.voter-handle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.poll-stats {
    display: flex;
    gap: 1.25rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.poll-votes-count {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.poll-time-left {
    color: #4CAF50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.poll-actions {
    display: flex;
    gap: 0.5rem;
}

.poll-share-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.poll-share-btn:hover {
    background: var(--accent-color);
    color: #4CAF50;
}

/* Poll Results View */
.poll-container.results .poll-option {
    cursor: default;
}

.poll-container.results .poll-option:hover {
    transform: none;
    box-shadow: none;
}

.poll-container.results .poll-option-bar {
    opacity: 1;
}

.poll-container.results .poll-option.voted .poll-option-bar {
    opacity: 0.2;
}

/* Voted state */
.poll-container.voted .poll-option {
    cursor: default;
}

.poll-container.voted .poll-option:hover {
    transform: none;
    box-shadow: none;
}

.poll-container.voted .poll-option-bar {
    opacity: 0.2;
}

/* Animation for vote updates */
@keyframes voteUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.poll-option.vote-updated {
    animation: voteUpdate 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Poll Expired */
.poll-container.expired .poll-option {
    cursor: default;
    opacity: 0.7;
}

.poll-container.expired .poll-option:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}

.poll-container.expired .poll-time-left {
    color: #ff4757;
}

/* Poll Urgency States */
.poll-container.poll-urgent {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.05);
    animation: urgentPulse 2s infinite;
}

.poll-container.poll-urgent .poll-time-left {
    color: #ff4757;
    font-weight: 700;
    animation: urgentBlink 1s infinite;
}

.poll-container.poll-ending-soon {
    border-color: #ffa502;
    background: rgba(255, 165, 2, 0.05);
}

.poll-container.poll-ending-soon .poll-time-left {
    color: #ffa502;
    font-weight: 600;
}

.poll-container.poll-expired {
    border-color: #666;
    background: rgba(102, 102, 102, 0.05);
    opacity: 0.8;
}

.poll-container.poll-expired .poll-time-left {
    color: #666;
    font-weight: 600;
}

@keyframes urgentPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
    }
}

@keyframes urgentBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Vote Feedback */
.poll-vote-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    pointer-events: none;
}

.poll-vote-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.poll-vote-feedback i {
    font-size: 1.2rem;
}

/* Voting state */
.poll-option.voting {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .poll-container {
        padding: 1rem;
        margin: 0.75rem 0;
    }

    .poll-question {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .poll-option {
        padding: 0.75rem;
    }

    .poll-option-content {
        gap: 0.75rem;
    }

    .poll-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .poll-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}