/* Poll Widget Styles */
#poll-widget-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    z-index: 99999;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    width: 350px;
    max-width: 90vw;
    transition: opacity 1s ease-in-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translate(-50%, 100px) scale(0.9);
    pointer-events: none;
}

#poll-widget-container.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

@keyframes flameBorder {
    0% { border-color: rgba(255,255,255,0.5); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); }
    20% { border-color: #ff7e5f; box-shadow: 0 0 20px #ff7e5f, 0 15px 35px rgba(0, 0, 0, 0.2); }
    40% { border-color: #feb47b; box-shadow: 0 0 30px #feb47b, 0 15px 35px rgba(0, 0, 0, 0.2); }
    60% { border-color: #ff9966; box-shadow: 0 0 25px #ff9966, 0 15px 35px rgba(0, 0, 0, 0.2); }
    80% { border-color: #ff5e62; box-shadow: 0 0 20px #ff5e62, 0 15px 35px rgba(0, 0, 0, 0.2); }
    100% { border-color: rgba(255,255,255,0.5); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); }
}

.poll-card {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255,255,255,0.5);
    overflow: hidden;
    color: #333;
}

#poll-widget-container.show .poll-card {
    animation: flameBorder 2.5s ease-in-out 1;
}

.poll-header {
    padding: 15px 20px 10px;
    position: relative;
}

.poll-close {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: 0.2s;
    padding: 0;
    line-height: 1;
}

.poll-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.poll-image {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

.poll-question {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 5px 0 15px 0;
    line-height: 1.4;
}

.poll-options {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-option-btn {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.poll-option-btn:hover {
    background: rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

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

/* Results state */
.poll-results {
    padding: 0 20px 20px;
    display: none;
}

.poll-result-item {
    margin-bottom: 12px;
}

.poll-result-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.poll-result-bar-bg {
    background: rgba(0,0,0,0.1);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.poll-result-bar-fill {
    background: #0ea5e9;
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.poll-message {
    text-align: center;
    font-weight: bold;
    padding: 20px;
    display: none;
}

.poll-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

@media (max-width: 500px) {
    #poll-widget-container {
        width: 90%;
        bottom: 80px;
    }
}
