/* Hurpedia Allemansrätten-quiz v1.0.0 */

.hp-aq-root {
    --hpaq-primary: #3377bb;
    --hpaq-primary-dark: #2a5f93;
    --hpaq-primary-soft: #eef5fc;
    --hpaq-correct: #0d9551;
    --hpaq-correct-soft: #e8f5ee;
    --hpaq-wrong: #dc2626;
    --hpaq-wrong-soft: #fee2e2;
    --hpaq-amber: #f59e0b;
    --hpaq-amber-soft: #fef3c7;
    --hpaq-bg: #faf9f7;
    --hpaq-card: #ffffff;
    --hpaq-text: #1f2937;
    --hpaq-muted: #6b7280;
    --hpaq-border: #e5e7eb;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--hpaq-text);
    background: var(--hpaq-bg);
    border: 1px solid var(--hpaq-border);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

.hp-aq-root *,
.hp-aq-root *::before,
.hp-aq-root *::after { box-sizing: border-box; }

.hp-aq-root .hp-aq-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--hpaq-muted);
    font-style: italic;
}

/* Header */
.hp-aq-root .hpaq-header {
    margin: 0 0 16px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--hpaq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hp-aq-root .hpaq-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.hp-aq-root .hpaq-counter {
    background: var(--hpaq-primary-soft);
    color: var(--hpaq-primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    flex: 0 0 auto;
}

/* Progress bar */
.hp-aq-root .hpaq-progress {
    background: var(--hpaq-border);
    border-radius: 999px;
    height: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.hp-aq-root .hpaq-progress-bar {
    background: var(--hpaq-primary);
    height: 100%;
    transition: width 0.3s ease;
}

/* Question */
.hp-aq-root .hpaq-question {
    background: var(--hpaq-card);
    border: 1px solid var(--hpaq-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.hp-aq-root .hpaq-question-text {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Answer buttons */
.hp-aq-root .hpaq-answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.hp-aq-root .hpaq-answer-btn {
    padding: 14px 20px;
    background: #fff;
    border: 2px solid var(--hpaq-border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--hpaq-text);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
}

.hp-aq-root .hpaq-answer-btn:hover:not(:disabled) {
    background: var(--hpaq-primary-soft);
    border-color: var(--hpaq-primary);
    color: var(--hpaq-primary-dark);
}

.hp-aq-root .hpaq-answer-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.hp-aq-root .hpaq-answer-btn.hpaq-correct-answer {
    background: var(--hpaq-correct-soft);
    border-color: var(--hpaq-correct);
    color: var(--hpaq-correct);
    opacity: 1;
}

.hp-aq-root .hpaq-answer-btn.hpaq-wrong-answer {
    background: var(--hpaq-wrong-soft);
    border-color: var(--hpaq-wrong);
    color: var(--hpaq-wrong);
    opacity: 1;
}

.hp-aq-root .hpaq-answer-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1rem;
}

/* Feedback */
.hp-aq-root .hpaq-feedback {
    border-left: 4px solid var(--hpaq-primary);
    background: var(--hpaq-primary-soft);
    padding: 14px 16px;
    border-radius: 0 6px 6px 0;
    margin: 16px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.hp-aq-root .hpaq-feedback.hpaq-feedback-correct {
    border-color: var(--hpaq-correct);
    background: var(--hpaq-correct-soft);
}

.hp-aq-root .hpaq-feedback.hpaq-feedback-wrong {
    border-color: var(--hpaq-wrong);
    background: var(--hpaq-wrong-soft);
}

.hp-aq-root .hpaq-feedback-title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 1rem;
}

.hp-aq-root .hpaq-feedback-text {
    margin: 0 0 8px;
}

.hp-aq-root .hpaq-feedback-source {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--hpaq-muted);
    font-style: italic;
}

/* Next button */
.hp-aq-root .hpaq-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.hp-aq-root .hpaq-btn {
    padding: 10px 24px;
    background: var(--hpaq-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.hp-aq-root .hpaq-btn:hover {
    background: var(--hpaq-primary-dark);
}

.hp-aq-root .hpaq-btn.hpaq-btn-secondary {
    background: #fff;
    color: var(--hpaq-primary-dark);
    border: 1px solid var(--hpaq-primary);
}

.hp-aq-root .hpaq-btn.hpaq-btn-secondary:hover {
    background: var(--hpaq-primary-soft);
}

/* Result screen */
.hp-aq-root .hpaq-result {
    text-align: center;
    padding: 20px 0;
}

.hp-aq-root .hpaq-result-emoji {
    font-size: 4rem;
    line-height: 1;
    margin: 0 0 12px;
}

.hp-aq-root .hpaq-result-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--hpaq-primary-dark);
    margin: 0 0 8px;
    font-variant-numeric: tabular-nums;
}

.hp-aq-root .hpaq-result-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hpaq-text);
    margin: 0 0 8px;
}

.hp-aq-root .hpaq-result-message {
    font-size: 0.95rem;
    color: var(--hpaq-muted);
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

.hp-aq-root .hpaq-result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Delningsblock */
.hp-aq-root .hpaq-share {
    margin: 20px 0 0;
    padding: 16px;
    background: var(--hpaq-card);
    border: 1px solid var(--hpaq-border);
    border-radius: 10px;
    text-align: center;
}

.hp-aq-root .hpaq-share-title {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hpaq-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hp-aq-root .hpaq-share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.hp-aq-root .hpaq-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--hpaq-border);
    border-radius: 8px;
    color: var(--hpaq-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.2;
    min-width: 0;
}

.hp-aq-root .hpaq-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.hp-aq-root .hpaq-share-btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
}

/* Brand-färger */
.hp-aq-root .hpaq-share-btn.hpaq-share-facebook {
    border-color: #1877f2;
    color: #1877f2;
}
.hp-aq-root .hpaq-share-btn.hpaq-share-facebook:hover {
    background: #1877f2;
    color: #fff;
}

.hp-aq-root .hpaq-share-btn.hpaq-share-messenger {
    border-color: #00b2ff;
    color: #00b2ff;
}
.hp-aq-root .hpaq-share-btn.hpaq-share-messenger:hover {
    background: #00b2ff;
    color: #fff;
}

.hp-aq-root .hpaq-share-btn.hpaq-share-x {
    border-color: #000;
    color: #000;
}
.hp-aq-root .hpaq-share-btn.hpaq-share-x:hover {
    background: #000;
    color: #fff;
}

.hp-aq-root .hpaq-share-btn.hpaq-share-email {
    border-color: var(--hpaq-muted);
    color: var(--hpaq-text);
}
.hp-aq-root .hpaq-share-btn.hpaq-share-email:hover {
    background: var(--hpaq-text);
    color: #fff;
}

.hp-aq-root .hpaq-share-btn.hpaq-share-copy {
    border-color: var(--hpaq-primary);
    color: var(--hpaq-primary-dark);
}
.hp-aq-root .hpaq-share-btn.hpaq-share-copy:hover {
    background: var(--hpaq-primary);
    color: #fff;
}

.hp-aq-root .hpaq-share-btn.hpaq-share-copied {
    background: var(--hpaq-correct);
    color: #fff;
    border-color: var(--hpaq-correct);
}

/* Native share (mobil) */
.hp-aq-root .hpaq-share-native {
    margin-top: 10px;
    font-size: 0.85rem;
}

.hp-aq-root .hpaq-share-native button {
    background: none;
    border: none;
    color: var(--hpaq-primary-dark);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 4px 8px;
}

/* Sammanställning */
.hp-aq-root .hpaq-summary {
    text-align: left;
    margin-top: 24px;
    border-top: 1px solid var(--hpaq-border);
    padding-top: 20px;
}

.hp-aq-root .hpaq-summary-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
}

.hp-aq-root .hpaq-summary-item {
    background: #fff;
    border: 1px solid var(--hpaq-border);
    border-left: 4px solid var(--hpaq-correct);
    border-radius: 0 6px 6px 0;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.hp-aq-root .hpaq-summary-item.hpaq-summary-wrong {
    border-left-color: var(--hpaq-wrong);
}

.hp-aq-root .hpaq-summary-item-num {
    font-size: 0.75rem;
    color: var(--hpaq-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hp-aq-root .hpaq-summary-item-q {
    display: block;
    font-weight: 600;
    margin: 4px 0;
}

/* Mobile */
@media (max-width: 480px) {
    .hp-aq-root { padding: 14px; margin: 16px 0; }
    .hp-aq-root .hpaq-question { padding: 14px; }
    .hp-aq-root .hpaq-question-text { font-size: 0.98rem; }
    .hp-aq-root .hpaq-result-score { font-size: 2rem; }
    .hp-aq-root .hpaq-result-emoji { font-size: 3rem; }
    .hp-aq-root .hpaq-answer-btn { padding: 12px 12px; }
}
