/**
 * WP Schnellumfragen — Frontend Styles
 *
 * @package WP_Schnellumfragen
 */

/* Container */
.wpsu-poll-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 720px;
    margin: 2rem auto;
    line-height: 1.5;
    color: #1e293b;
}

.wpsu-loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

/* Poll Form */
.wpsu-poll {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wpsu-poll__question {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #0f172a;
}

.wpsu-poll__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Badges */
.wpsu-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.wpsu-badge--info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.wpsu-badge--success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.wpsu-badge--muted { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* Options */
.wpsu-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wpsu-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.95rem;
    text-align: left;
    color: #334155;
}

.wpsu-option:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.wpsu-option--selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

.wpsu-option__check {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

/* User data fields */
.wpsu-userdata {
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.wpsu-userdata h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 0 0 1rem;
}

.wpsu-userdata__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .wpsu-userdata__grid {
        grid-template-columns: 1fr;
    }
}

.wpsu-field {
    margin-bottom: 0.75rem;
}

.wpsu-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.3rem;
}

.wpsu-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.wpsu-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Submit */
.wpsu-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.wpsu-submit:hover { background: #1e293b; }
.wpsu-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.wpsu-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.75rem;
}

/* Error */
.wpsu-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Messages */
.wpsu-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.wpsu-message strong { display: block; margin-bottom: 0.25rem; }
.wpsu-message--expired { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.wpsu-message--info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ─── Results ─── */

.wpsu-results {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 10px;
    scroll-margin-top: 10px;
}

.wpsu-results__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: #0f172a;
}

.wpsu-thankyou {
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Bar chart rows */
.wpsu-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wpsu-chart__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 30% width for labels as required */
.wpsu-chart__label {
    width: 30%;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.wpsu-chart__barwrap {
    flex: 1;
    background: #f1f5f9;
    border-radius: 6px;
    height: 28px;
    overflow: hidden;
}

.wpsu-chart__bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.wpsu-chart__value {
    width: 80px;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}

.wpsu-chart__pct {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.75rem;
}

.wpsu-results__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #64748b;
}

.wpsu-results__total strong {
    font-size: 1.5rem;
    color: #0f172a;
}
