/* MoePoll Plugin Frontend Styles */

.moe-poll-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.moe-poll-title h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
}

/* Voting Form Styles */
.moe-poll-form {
    margin-bottom: 20px;
}

.moe-poll-options {
    margin-bottom: 20px;
}

.moe-poll-option {
    margin-bottom: 12px;
    padding: 0;
}

.moe-poll-option label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.moe-poll-option label:hover {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.moe-poll-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.moe-poll-option input[type="radio"]:checked+.moe-poll-option-text {
    font-weight: 600;
    color: #007cba;
}

.moe-poll-option label:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.moe-poll-option-text {
    flex: 1;
    font-size: 1em;
    color: #555;
}

.moe-poll-submit {
    text-align: center;
    margin-top: 20px;
}

.moe-poll-submit-button {
    background-color: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.moe-poll-submit-button:hover {
    background-color: #005a87;
}

.moe-poll-submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Results Styles */
.moe-poll-results {
    border-color: #28a745;
}

.moe-poll-results-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.moe-poll-results-info p {
    margin: 5px 0;
    color: #555;
}

.moe-poll-user-choice {
    color: #28a745 !important;
    font-weight: 600;
}

.moe-poll-results-chart {
    margin-bottom: 20px;
}

.moe-poll-result-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #e0e0e0;
}

.moe-poll-result-item.moe-poll-user-selected {
    background-color: #e8f5e8;
    border-left-color: #28a745;
}

.moe-poll-result-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.moe-poll-selected-indicator {
    color: #28a745;
    font-size: 1.2em;
}

.moe-poll-result-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.moe-poll-result-progress {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #28a745);
    border-radius: 10px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.moe-poll-result-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
}

.moe-poll-votes {
    font-weight: 600;
}

.moe-poll-percentage {
    font-weight: 600;
    color: #007cba;
}

.moe-poll-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.moe-poll-footer small {
    color: #999;
}

/* Loading State */
.moe-poll-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.moe-poll-loading p {
    margin: 0;
    font-style: italic;
}

/* Error Messages */
.moe-poll-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    text-align: center;
    margin: 20px 0;
}

/* Login Required */
.moe-poll-login-required {
    text-align: center;
    padding: 20px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.moe-poll-login-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.moe-poll-login-button:hover {
    background-color: #005a87;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .moe-poll-container {
        margin: 10px;
        padding: 15px;
    }

    .moe-poll-title h3 {
        font-size: 1.1em;
    }

    .moe-poll-option label {
        padding: 10px;
    }

    .moe-poll-result-item {
        padding: 12px;
    }

    .moe-poll-result-stats {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .moe-poll-container {
        margin: 5px;
        padding: 12px;
    }

    .moe-poll-submit-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}