/* ════════════════════════════════════════════════════════════════
   PQ PDF — Tool Rating System  (May 2026)
   Covers both the post-success widget and the public panel.
   All dark-theme, CSP-compliant (no inline styles).
   ════════════════════════════════════════════════════════════════ */

/* ── Shared helpers ─────────────────────────────────────────────── */
.pq-star-display {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}
.pq-star-display .s-full  { color: #ffd700; }
.pq-star-display .s-half  { color: #ffd700; opacity: 0.55; }
.pq-star-display .s-empty { color: #2a3c58; }

/* ════════════════════════════════════════════════════════════════
   SECTION 1 — RATING WIDGET  (appears after tool success)
   ════════════════════════════════════════════════════════════════ */

.pq-rate-widget {
    margin-top: 20px;
    margin-bottom: 32px;
    background: #0c1525;
    border: 1px solid rgba(255, 140, 0, 0.25);
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 540px;
    animation: pqRateSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pqRateSlide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pq-rate-widget-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.pq-rate-widget-head-icon {
    font-size: 1.2rem;
    line-height: 1;
}
.pq-rate-widget-head-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f0e6d3;
    letter-spacing: 0.01em;
}
.pq-rate-widget-head-sub {
    margin-left: auto;
    font-size: 0.72rem;
    color: #5a4a38;
    white-space: nowrap;
}

/* ── Category rows ─────────────────────────────────────────────── */
.pq-rate-categories {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.pq-rate-cat-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.pq-rate-cat-label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 130px;
    font-size: 0.82rem;
    color: #a89070;
    font-weight: 500;
}
.pq-rate-cat-label-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ── Star buttons ──────────────────────────────────────────────── */
.pq-stars {
    display: flex;
    gap: 4px;
}
.pq-star-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    color: #2a3c58;
    transition: color 0.12s ease, transform 0.1s ease, text-shadow 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.pq-star-btn:hover,
.pq-star-btn.pq-star-hover {
    color: #ffd700;
    transform: scale(1.18);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.pq-star-btn.pq-star-active {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
}
.pq-star-btn:focus-visible {
    outline: 2px solid rgba(255, 140, 0, 0.6);
    border-radius: 3px;
}

/* ── Helpful row ───────────────────────────────────────────────── */
.pq-rate-helpful-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #080f1e;
    border-radius: 8px;
    border: 1px solid #1a2840;
}
.pq-rate-helpful-label {
    font-size: 0.82rem;
    color: #a89070;
    font-weight: 500;
    flex: 1;
}
.pq-helpful-btn {
    background: none;
    border: 1px solid #1a2840;
    border-radius: 8px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.pq-helpful-btn:hover {
    background: rgba(255, 140, 0, 0.08);
    border-color: rgba(255, 140, 0, 0.4);
    transform: scale(1.08);
}
.pq-helpful-btn.pq-helpful-yes.pq-helpful-active {
    background: rgba(0, 230, 118, 0.12);
    border-color: rgba(0, 230, 118, 0.5);
}
.pq-helpful-btn.pq-helpful-no.pq-helpful-active {
    background: rgba(255, 23, 68, 0.12);
    border-color: rgba(255, 23, 68, 0.5);
}
.pq-helpful-btn:focus-visible {
    outline: 2px solid rgba(255, 140, 0, 0.6);
    border-radius: 8px;
}

/* ── Comment ───────────────────────────────────────────────────── */
.pq-rate-comment-wrap {
    margin-bottom: 18px;
    position: relative;
}
.pq-rate-comment {
    width: 100%;
    background: #080f1e;
    border: 1px solid #1a2840;
    border-radius: 8px;
    padding: 10px 14px;
    color: #f0e6d3;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}
.pq-rate-comment::placeholder {
    color: #3a2e22;
}
.pq-rate-comment:focus {
    outline: none;
    border-color: rgba(255, 140, 0, 0.45);
}
.pq-rate-char-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.7rem;
    color: #3a2e22;
    pointer-events: none;
    transition: color 0.15s;
}
.pq-rate-char-count.pq-char-warn {
    color: #ff8c00;
}

/* ── Submit ────────────────────────────────────────────────────── */
.pq-rate-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pq-rate-submit-btn {
    background: linear-gradient(135deg, #ff8c00 0%, #cc7000 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    letter-spacing: 0.02em;
}
.pq-rate-submit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}
.pq-rate-submit-btn:not(:disabled):hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.3);
}
.pq-rate-submit-btn:not(:disabled):active {
    transform: translateY(0);
}
.pq-rate-submit-btn:focus-visible {
    outline: 2px solid rgba(255, 140, 0, 0.7);
    outline-offset: 2px;
}
.pq-rate-submit-note {
    font-size: 0.72rem;
    color: #3a2e22;
}

/* ── Submitting state ──────────────────────────────────────────── */
.pq-rate-widget.pq-submitting .pq-rate-submit-btn {
    opacity: 0.5;
    cursor: wait;
}

/* ── Done / thank you state ────────────────────────────────────── */
.pq-rate-done {
    text-align: center;
    padding: 8px 0 4px;
    animation: pqRateDone 0.3s ease;
}
@keyframes pqRateDone {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.pq-rate-done-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}
.pq-rate-done-msg {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f0e6d3;
    margin-bottom: 4px;
}
.pq-rate-done-sub {
    font-size: 0.78rem;
    color: #5a4a38;
    margin-bottom: 16px;
}
.pq-rate-done-update {
    background: none;
    border: 1px solid #1a2840;
    border-radius: 6px;
    color: #a89070;
    font-size: 0.75rem;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    margin-top: 6px;
}
.pq-rate-done-update:hover {
    border-color: rgba(255, 140, 0, 0.4);
    color: #ff8c00;
}

/* ════════════════════════════════════════════════════════════════
   SECTION 2 — PUBLIC RATINGS PANEL  (above footer, always shown)
   ════════════════════════════════════════════════════════════════ */

.pq-ratings-panel {
    position: relative;
    z-index: 2;
    margin-top: 24px;
}
.pq-ratings-panel-inner {
    background: #0c1525;
    border: 1px solid #1a2840;
    border-radius: 12px;
    padding: 28px 28px 24px;
}

.pq-ratings-panel-heading {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 28px;
}
.pq-ratings-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f0e6d3;
    letter-spacing: 0.01em;
}
.pq-ratings-panel-overall {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pq-ratings-panel-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffd700;
    line-height: 1;
}
.pq-ratings-panel-count {
    font-size: 0.78rem;
    color: #5a4a38;
}

/* ── Category grid ──────────────────────────────────────────────── */
.pq-ratings-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.pq-ratings-cat-card {
    background: #0c1525;
    border: 1px solid #1a2840;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s;
}
.pq-ratings-cat-card:hover {
    border-color: rgba(255, 140, 0, 0.3);
}
.pq-ratings-cat-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pq-ratings-cat-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.pq-ratings-cat-name {
    font-size: 0.8rem;
    color: #a89070;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pq-ratings-cat-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pq-ratings-cat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f0e6d3;
    line-height: 1;
    min-width: 38px;
}
.pq-ratings-cat-bar-wrap {
    flex: 1;
    height: 6px;
    background: #1a2840;
    border-radius: 3px;
    overflow: hidden;
}
.pq-ratings-cat-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #ffd700);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Helpful bar ────────────────────────────────────────────────── */
.pq-ratings-helpful {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #0c1525;
    border: 1px solid #1a2840;
    border-radius: 10px;
    margin-bottom: 28px;
}
.pq-ratings-helpful-label {
    font-size: 0.82rem;
    color: #a89070;
    white-space: nowrap;
}
.pq-ratings-helpful-bar-wrap {
    flex: 1;
    height: 8px;
    background: #1a2840;
    border-radius: 4px;
    overflow: hidden;
}
.pq-ratings-helpful-bar {
    height: 100%;
    background: linear-gradient(90deg, #00e676, #00b850);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.pq-ratings-helpful-pct {
    font-size: 0.88rem;
    font-weight: 700;
    color: #00e676;
    min-width: 40px;
    text-align: right;
}
.pq-ratings-helpful-votes {
    font-size: 0.75rem;
    color: #3a2e22;
    white-space: nowrap;
}

/* ── Comments section ────────────────────────────────────────────── */
.pq-ratings-comments-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #5a4a38;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.pq-ratings-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pq-comment-card {
    background: #0c1525;
    border: 1px solid #1a2840;
    border-radius: 10px;
    padding: 14px 18px;
    transition: border-color 0.2s;
}
.pq-comment-card:hover {
    border-color: rgba(255, 140, 0, 0.2);
}
.pq-comment-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.pq-comment-card-stars {
    display: flex;
    gap: 2px;
    font-size: 0.78rem;
}
.pq-comment-card-stars .s-full  { color: #ffd700; }
.pq-comment-card-stars .s-empty { color: #2a3c58; }
.pq-comment-card-helpful {
    font-size: 0.75rem;
    color: #3a2e22;
}
.pq-comment-card-helpful.yes { color: #00b850; }
.pq-comment-card-helpful.no  { color: #9b1c2e; }
.pq-comment-card-date {
    margin-left: auto;
    font-size: 0.72rem;
    color: #3a2e22;
}
.pq-comment-card-text {
    font-size: 0.87rem;
    color: #c8b89a;
    line-height: 1.55;
}

/* ── Empty / loading states ─────────────────────────────────────── */
.pq-ratings-empty {
    text-align: center;
    padding: 32px 0;
    color: #3a2e22;
    font-size: 0.88rem;
}
.pq-ratings-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.pq-ratings-loading {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 24px 0;
}
.pq-ratings-loading span {
    width: 8px;
    height: 8px;
    background: rgba(255, 140, 0, 0.4);
    border-radius: 50%;
    animation: pqDot 1.2s infinite ease-in-out;
}
.pq-ratings-loading span:nth-child(2) { animation-delay: 0.2s; }
.pq-ratings-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pqDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ── "Be the first to rate" CTA ─────────────────────────────────── */
.pq-ratings-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #ff8c00;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pq-ratings-cta:hover {
    color: #ffd700;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .pq-rate-widget {
        padding: 18px 16px;
        border-radius: 10px;
    }
    .pq-rate-cat-label {
        min-width: 100px;
    }
    .pq-star-btn {
        font-size: 1.35rem;
    }
    .pq-ratings-panel {
        padding: 28px 14px 32px;
    }
    .pq-ratings-helpful {
        flex-wrap: wrap;
    }
    .pq-rate-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .pq-rate-submit-btn {
        width: 100%;
    }
}
