/* ==========================================
   FIVEM PARTICLE FX LIST
   Page-specific styles for /tools/fivem/particles
   ========================================== */

.pfx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Inline code ---------- */

.tool-section code,
.pfx-note code,
.pfx-column-card code,
.pfx-tips code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 1px 5px;
    color: #e4e4e7;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* ---------- Browse head + stats ---------- */

.pfx-browse-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 16px;
}

.pfx-browse-head .tool-section-head {
    flex: 1 1 460px;
    margin-bottom: 0;
}

.pfx-stats {
    display: flex;
    flex: 0 0 auto;
    margin: 0;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pfx-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 16px;
}

.pfx-stat + .pfx-stat {
    border-left: 1px solid var(--border-color);
}

.pfx-stat dt {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
}

.pfx-stat dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ---------- Browser panel ---------- */

.pfx-browser {
    position: relative;
    overflow: hidden;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.pfx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Search */

.pfx-search {
    position: relative;
    display: flex;
    flex: 1 1 300px;
    align-items: center;
    min-width: 0;
}

.pfx-search-icon,
.pfx-field-icon {
    position: absolute;
    left: 12px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.pfx-input,
.pfx-select,
.pfx-check,
.pfx-reset {
    height: 38px;
    font-family: var(--font-primary);
    font-size: 13px;
    color: var(--text);
    background: #0b0b0b;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.pfx-input {
    width: 100%;
    padding: 0 40px 0 34px;
}

.pfx-input::placeholder {
    color: #6b6b73;
}

.pfx-input:focus,
.pfx-select:focus {
    outline: none;
    border-color: rgba(140, 82, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.16);
}

.pfx-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.pfx-kbd {
    position: absolute;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    pointer-events: none;
}

.pfx-search-clear {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 5px;
}

.pfx-search-clear:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.pfx-search.pfx-has-value .pfx-kbd {
    display: none;
}

/* Selects */

.pfx-field {
    position: relative;
    display: flex;
    align-items: center;
}

.pfx-field-dict {
    flex: 0 1 250px;
    min-width: 0;
}

.pfx-field-sort {
    flex: 0 1 190px;
    min-width: 0;
}

.pfx-select {
    width: 100%;
    min-width: 0;
    padding: 0 28px 0 32px;
    color-scheme: dark;
    cursor: pointer;
    text-overflow: ellipsis;
}

/* Toggle + reset */

.pfx-check {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.pfx-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.pfx-check:hover {
    color: var(--text);
}

.pfx-check:has(input:checked) {
    color: var(--text);
    border-color: rgba(140, 82, 255, 0.55);
    background: rgba(140, 82, 255, 0.1);
}

.pfx-reset {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
}

.pfx-reset:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.28);
}

/* ---------- Table ---------- */

.pfx-table-wrap {
    max-height: min(640px, 68vh);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.pfx-table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.pfx-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.pfx-table-wrap::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.26);
}

.pfx-table {
    width: 100%;
    min-width: 820px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* Numbers get fixed widths so 10-digit hashes never truncate; name takes the rest. */
.pfx-th-dict { width: 28%; }
.pfx-th-num  { width: 116px; }

.pfx-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 16px;
    font-size: 10.5px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: #141414;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.pfx-table thead th.pfx-th-num {
    text-align: right;
}

.pfx-table tbody td {
    height: 38px;
    padding: 0 16px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    vertical-align: middle;
}

.pfx-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.015);
}

.pfx-table tbody tr:last-child td {
    border-bottom: 0;
}

.pfx-table tbody tr:hover td {
    background: rgba(140, 82, 255, 0.07);
}

.pfx-cell-num {
    text-align: right;
    white-space: nowrap;
}

/* Copy buttons */

.pfx-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 4px 6px;
    margin: 0 -6px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #ececf1;
    text-align: left;
    cursor: copy;
    background: transparent;
    border: 0;
    border-radius: 5px;
    transition: color 0.15s ease, background 0.15s ease;
}

.pfx-copy span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfx-copy .pfx-icon {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    opacity: 0.35;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.pfx-copy:hover,
.pfx-copy:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.pfx-copy:focus-visible {
    box-shadow: 0 0 0 2px rgba(140, 82, 255, 0.7);
}

.pfx-copy:hover .pfx-icon,
.pfx-copy:focus-visible .pfx-icon {
    color: var(--primary);
    opacity: 1;
}

.pfx-copy.pfx-copied {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.pfx-cell-num .pfx-copy {
    font-size: 12.5px;
    color: #a6a6b0;
    font-variant-numeric: tabular-nums;
}

.pfx-cell-num .pfx-copy:hover,
.pfx-cell-num .pfx-copy:focus-visible {
    color: var(--text);
}

/* Dictionary pill */

.pfx-dict {
    display: inline-block;
    max-width: 100%;
    padding: 3px 9px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    color: #cdb6ff;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background: rgba(140, 82, 255, 0.1);
    border: 1px solid rgba(140, 82, 255, 0.24);
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.pfx-dict:hover,
.pfx-dict:focus-visible {
    color: #ffffff;
    background: rgba(140, 82, 255, 0.28);
    border-color: rgba(140, 82, 255, 0.6);
    outline: none;
}

.pfx-unnamed {
    display: inline-block;
    padding: 2px 0;
    font-family: var(--font-mono);
    font-size: 12px;
    font-style: italic;
    color: #7a7a84;
    cursor: help;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.22);
}

/* ---------- Empty / error / actions / status ---------- */

.pfx-empty {
    padding: 56px 24px;
    text-align: center;
}

.pfx-empty > i {
    margin-bottom: 14px;
    font-size: 24px;
    color: #52525b;
}

.pfx-empty p {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text-muted);
}

.pfx-empty p strong {
    color: var(--text);
}

.pfx-reset-visible {
    margin-top: 16px;
}

.pfx-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.09);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}

.pfx-error > i {
    font-size: 15px;
    color: #f87171;
}

.pfx-error > div {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
}

.pfx-error strong {
    color: #fee2e2;
    font-size: 13px;
}

.pfx-error span {
    color: #fca5a5;
}

.pfx-retry {
    padding: 7px 14px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    color: #fee2e2;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 5px;
}

.pfx-retry:hover {
    background: rgba(239, 68, 68, 0.3);
}

.pfx-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 14px;
}

.pfx-more {
    padding: 8px 18px;
    font-family: var(--font-primary);
    font-size: 12.5px;
    font-weight: 600;
    color: #cdb6ff;
    cursor: pointer;
    background: rgba(140, 82, 255, 0.1);
    border: 1px solid rgba(140, 82, 255, 0.4);
    border-radius: 6px;
    transition: color 0.16s ease, background 0.16s ease;
}

.pfx-more:hover {
    color: #ffffff;
    background: rgba(140, 82, 255, 0.24);
}

.pfx-sentinel {
    width: 100%;
    height: 1px;
}

.pfx-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    min-height: 42px;
    padding: 8px 16px;
    background: #141414;
    border-top: 1px solid var(--border-color);
}

.pfx-count {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.pfx-count strong {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text);
}

.pfx-load-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 12px;
    color: #c4a5ff;
}

.pfx-load-state::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: pfx-pulse 1s ease-in-out infinite;
}

@keyframes pfx-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.pfx-status-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    font-size: 12px;
    color: #74747d;
}

.pfx-noscript {
    margin: 0;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.pfx-noscript a {
    color: #c4a5ff;
}

/* ---------- Notes ---------- */

.pfx-note {
    display: flex;
    gap: 9px;
    margin: 20px 0 0;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 7px;
}

.pfx-note > i {
    margin-top: 3px;
    color: #c4a5ff;
}

.pfx-note > span {
    flex: 1;
    min-width: 0;
}

.pfx-note-wide {
    margin-top: 16px;
}

/* ---------- Column explainer ---------- */

.pfx-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pfx-column-card {
    padding: 16px;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pfx-column-tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #c4a5ff;
    background: rgba(140, 82, 255, 0.12);
    border: 1px solid rgba(140, 82, 255, 0.25);
    border-radius: 999px;
}

.pfx-column-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.pfx-column-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ---------- Dictionary grid ---------- */

.pfx-dict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.pfx-dict-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 14px;
    font-family: var(--font-primary);
    text-align: left;
    cursor: pointer;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.pfx-dict-card:hover,
.pfx-dict-card:focus-visible {
    background: rgba(140, 82, 255, 0.08);
    border-color: rgba(140, 82, 255, 0.45);
    outline: none;
}

.pfx-dict-card-name {
    max-width: 100%;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pfx-dict-card-count {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ---------- Tips ---------- */

.pfx-tips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pfx-tips li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

.pfx-tips li::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 1px;
}

.pfx-tips strong {
    color: var(--text);
}

/* ---------- Toast / back-to-top ---------- */

.pfx-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 90;
    max-width: calc(100vw - 32px);
    padding: 10px 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #e9e4ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    background: #1b1428;
    border: 1px solid rgba(140, 82, 255, 0.55);
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pfx-toast.pfx-toast-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pfx-toast.pfx-toast-error {
    color: #fee2e2;
    background: #2a1215;
    border-color: rgba(239, 68, 68, 0.55);
}

.pfx-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    background: #17131f;
    border: 1px solid rgba(140, 82, 255, 0.4);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    place-items: center;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.pfx-top:hover {
    background: #241a35;
    border-color: rgba(140, 82, 255, 0.75);
}

/* ---------- Focus ---------- */

.pfx-check:has(input:focus-visible),
.pfx-reset:focus-visible,
.pfx-more:focus-visible,
.pfx-retry:focus-visible,
.pfx-search-clear:focus-visible,
.pfx-top:focus-visible,
.pfx-dict-card:focus-visible {
    outline: 2px solid rgba(140, 82, 255, 0.8);
    outline-offset: 2px;
}

/* Author display rules would otherwise win over the UA [hidden] rule. */
.pfx-load-state[hidden],
.pfx-error[hidden],
.pfx-top[hidden],
.pfx-search-clear[hidden],
.pfx-reset[hidden],
.pfx-table[hidden],
.pfx-more[hidden],
.pfx-empty[hidden] {
    display: none !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .pfx-stats {
        flex: 1 1 100%;
    }

    .pfx-stat {
        flex: 1 1 0;
    }
}

@media (max-width: 1024px) {


    .pfx-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pfx-search {
        flex-basis: 100%;
    }

    .pfx-field-dict,
    .pfx-field-sort {
        flex: 1 1 200px;
    }
}

@media (max-width: 768px) {
    .pfx-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pfx-stat + .pfx-stat {
        border-left: 0;
    }

    .pfx-stat:nth-child(even) {
        border-left: 1px solid var(--border-color);
    }

    .pfx-stat:nth-child(n + 3) {
        border-top: 1px solid var(--border-color);
    }

    .pfx-table-wrap {
        max-height: 70vh;
    }

    .pfx-table {
        min-width: 780px;
    }

    .pfx-th-num {
        width: 124px;
    }

    .pfx-table thead th,
    .pfx-table tbody td {
        padding-right: 12px;
        padding-left: 12px;
    }

    .pfx-status-hint {
        display: none;
    }

    .pfx-tips {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .pfx-toolbar {
        padding: 10px;
    }

    .pfx-field-dict,
    .pfx-field-sort {
        flex: 1 1 100%;
    }

    .pfx-check {
        flex: 1 1 auto;
        justify-content: center;
    }

    .pfx-columns {
        grid-template-columns: minmax(0, 1fr);
    }


    .pfx-toast {
        font-size: 11.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pfx-input,
    .pfx-select,
    .pfx-check,
    .pfx-copy,
    .pfx-dict,
    .pfx-dict-card,
    .pfx-top,
    .pfx-toast,
    .pfx-more,
    .pfx-reset {
        transition: none;
    }

    .pfx-load-state::before {
        animation: none;
    }
}
