/**
 * freepoll/assets/css/frontend.css
 * 
 * Frontend styles for FreePoll
 * Minimal, theme-compatible styling
 */

/* Container */
.freepoll-container {
    max-width: 600px;
    margin: 1.5em 0;
    padding: 1.5em;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;
}

/* Question */
.freepoll-question {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 1em;
    color: inherit;
}

/* GDPR Notice */
.freepoll-gdpr-notice {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 1em;
    padding: 0.5em;
    background: #f5f5f5;
    border-radius: 3px;
}

/* Status messages */
.freepoll-status {
    padding: 0.75em 1em;
    margin-bottom: 1em;
    border-radius: 4px;
    font-size: 0.9em;
}

.freepoll-status-closed,
.freepoll-status-ended {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.freepoll-status-voted {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.freepoll-login-required {
    padding: 0.75em 1em;
    margin-bottom: 1em;
    background: #e7f3ff;
    color: #0056b3;
    border: 1px solid #b8daff;
    border-radius: 4px;
}

.freepoll-login-required a {
    color: inherit;
    font-weight: 600;
}

/* Options */
.freepoll-options {
    margin-bottom: 1em;
}

.freepoll-option {
    display: block;
    padding: 0.75em 1em;
    margin-bottom: 0.5em;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.freepoll-option:hover {
    border-color: #999;
    background: #f9f9f9;
}

.freepoll-option input[type="radio"],
.freepoll-option input[type="checkbox"] {
    margin-right: 0.75em;
    vertical-align: middle;
}

.freepoll-option-text {
    vertical-align: middle;
}

/* Text input */
.freepoll-options-text textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    min-height: 80px;
}

.freepoll-options-text textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Submit button */
.freepoll-submit {
    margin-top: 1em;
}

.freepoll-button {
    display: inline-block;
    padding: 0.75em 2em;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.freepoll-button:hover {
    background: #005a87;
}

.freepoll-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.freepoll-loading {
    display: inline-block;
    margin-left: 1em;
    color: #666;
    font-style: italic;
}

/* Message */
.freepoll-message {
    margin-top: 1em;
    padding: 0.75em 1em;
    border-radius: 4px;
}

.freepoll-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.freepoll-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* Results */
.freepoll-results {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.freepoll-results-title {
    font-weight: 600;
    margin-bottom: 1em;
    font-size: 1em;
}

.freepoll-result-item {
    margin-bottom: 1em;
}

.freepoll-result-option {
    margin-bottom: 0.25em;
    font-size: 0.95em;
}

.freepoll-result-bar-container {
    height: 24px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25em;
}

.freepoll-result-bar {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.freepoll-result-stats {
    font-size: 0.85em;
    color: #666;
}

.freepoll-result-percentage {
    font-weight: 600;
    margin-right: 0.5em;
}

.freepoll-result-votes {
    color: #888;
}

.freepoll-total-votes {
    margin-top: 1em;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* Text results */
.freepoll-text-results .freepoll-text-answers {
    list-style: none;
    padding: 0;
    margin: 1em 0 0 0;
}

.freepoll-text-answers li {
    padding: 0.75em;
    margin-bottom: 0.5em;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.95em;
}

/* End date */
.freepoll-end-date {
    margin-top: 1em;
    font-size: 0.85em;
    color: #666;
}

/* Error */
.freepoll-error {
    padding: 1em;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .freepoll-container {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .freepoll-option {
        background: #3d3d3d;
        border-color: #555;
    }
    
    .freepoll-option:hover {
        background: #4d4d4d;
        border-color: #666;
    }
    
    .freepoll-gdpr-notice {
        background: #3d3d3d;
        color: #aaa;
    }
    
    .freepoll-options-text textarea {
        background: #3d3d3d;
        border-color: #555;
        color: inherit;
    }
    
    .freepoll-result-bar-container {
        background: #444;
    }
    
    .freepoll-text-answers li {
        background: #3d3d3d;
        border-color: #555;
    }
}
