/* assets/frontend.css */

.ei-poll {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    max-width: 600px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ei-poll-question {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Options */
.ei-poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ei-poll-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ei-poll-option:hover {
    border-color: #c21719;
    background: #fff5f5;
    transform: translateX(5px);
}

.ei-poll-option:active {
    transform: scale(0.98);
}

.ei-poll-option.selected {
    border-color: #c21719;
    background: #c21719;
    color: #fff;
}

.ei-poll-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Results */
.ei-poll-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ei-result-item {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 18px;
    overflow: hidden;
}

.ei-result-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(194,23,25,0.15), rgba(194,23,25,0.08));
    border-radius: 8px;
    transition: width 0.8s ease;
}

.ei-result-text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.ei-result-percent {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 700;
    color: #c21719;
    z-index: 1;
}

.ei-total-votes {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Link */
.ei-poll-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #c21719;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.ei-poll-link:hover {
    background: #a01315;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194,23,25,0.3);
}

/* Loading state */
.ei-poll.loading {
    pointer-events: none;
    opacity: 0.7;
}

.ei-poll.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #eee;
    border-top-color: #c21719;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Already voted message */
.ei-voted-message {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

/* Animations */
.ei-poll-results {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .ei-poll {
        padding: 20px;
        margin: 20px 10px;
        border-radius: 10px;
    }
    
    .ei-poll-question {
        font-size: 16px;
    }
    
    .ei-poll-option {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .ei-result-item {
        padding: 12px 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ei-poll {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .ei-poll-question {
        color: #f0f0f0;
    }
    
    .ei-poll-option {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .ei-poll-option:hover {
        background: #3a2020;
    }
    
    .ei-result-item {
        background: #2a2a2a;
    }
    
    .ei-result-text {
        color: #e0e0e0;
    }
    
    .ei-total-votes {
        color: #888;
        border-color: #444;
    }
}