/* Poll Widget Styles */
.poll-widget {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.poll-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

.poll-bar-container {
    margin-bottom: 20px;
    position: relative;
}

.poll-bar {
    height: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.poll-bar-like,
.poll-bar-dislike {
    height: 100%;
    position: absolute;
    top: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-bar-like {
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    left: 0;
    border-radius: 6px 0 0 6px;
}

.poll-bar-dislike {
    background: linear-gradient(90deg, #9C27B0, #BA68C8);
    right: 0;
    border-radius: 0 6px 6px 0;
}

.poll-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
}

.poll-btn {
    flex: 1;
    max-width: 150px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.poll-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.poll-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.poll-btn-like {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: 2px solid #4CAF50;
}

.poll-btn-like:hover:not(:disabled) {
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
}

.poll-btn-dislike {
    background: linear-gradient(135deg, #9C27B0, #BA68C8);
    color: white;
    border: 2px solid #9C27B0;
}

.poll-btn-dislike:hover:not(:disabled) {
    background: linear-gradient(135deg, #BA68C8, #9C27B0);
}

.poll-btn-text {
    font-weight: 600;
}

.poll-percentage {
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.poll-message {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.poll-voted-message {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.poll-vpn-message {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.poll-comment-section {
    margin-top: 15px;
    text-align: center;
}

.poll-status-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.poll-comment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.poll-comment-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

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

.poll-comment-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.poll-comment-icon {
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.poll-widget.voted .poll-btn {
    cursor: default;
    pointer-events: none;
}

.poll-widget.loading .poll-btn {
    cursor: wait;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .poll-widget {
        margin: 15px;
        padding: 16px;
    }
    
    .poll-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .poll-buttons {
        gap: 8px;
    }
    
    .poll-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .poll-percentage {
        font-size: 12px;
        padding: 1px 6px;
    }
    
    .poll-comment-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .poll-comment-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .poll-widget {
        margin: 10px;
        padding: 12px;
    }
    
    .poll-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .poll-bar {
        height: 10px;
    }
    
    .poll-buttons {
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .poll-btn {
        max-width: none;
        padding: 10px 12px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .poll-comment-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .poll-comment-icon {
        font-size: 13px;
    }
    
    .poll-status-text {
        font-size: 11px;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .poll-widget {
        margin: 8px;
        padding: 10px;
    }
    
    .poll-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .poll-buttons {
        flex-direction: row;
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    .poll-btn {
        padding: 8px 10px;
        font-size: 13px;
        min-height: 36px;
    }
    
    .poll-btn-text {
        font-size: 13px;
    }
    
    .poll-percentage {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .poll-comment-btn {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .poll-comment-icon {
        font-size: 12px;
    }
    
    .poll-status-text {
        font-size: 10px;
    }
}

/* Animation for vote submission */
@keyframes voteSubmitted {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.poll-widget.vote-submitted {
    animation: voteSubmitted 0.5s ease-out;
}

/* Loading state */
.poll-widget.loading {
    position: relative;
}

.poll-widget.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    z-index: 1;
}

.poll-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.poll-btn:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.poll-widget:focus-within {
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

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