/* ==========================================================================
   FiveM Ped Components & Props
   Slot reference + outfit builder. Built on the shared tools page shell.
   ========================================================================== */

.ped-note code,
.ped-step code,
.ped-target-hint code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: #c4b5fd;
    background: rgba(140, 82, 255, 0.12);
    border: 1px solid rgba(140, 82, 255, 0.22);
    border-radius: 4px;
    padding: 1px 5px;
}

/* ---------- Target ped ---------- */

.ped-target {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 18px;
    margin-bottom: 20px;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.ped-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ped-target-input {
    max-width: 220px;
}

.ped-target-hint {
    flex: 1 1 320px;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-muted);
}

/* ---------- Shared inputs ---------- */

.ped-input {
    width: 100%;
    padding: 9px 11px;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ped-input::placeholder {
    color: rgba(161, 161, 170, 0.55);
}

.ped-input:focus-visible {
    border-color: rgba(140, 82, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.18);
}

.ped-input[aria-invalid="true"] {
    border-color: rgba(248, 113, 113, 0.7);
}

.ped-num {
    text-align: center;
    padding: 8px 6px;
    -moz-appearance: textfield;
}

.ped-num::-webkit-outer-spin-button,
.ped-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- Slot tables ---------- */

.ped-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-raised);
    -webkit-overflow-scrolling: touch;
}

.ped-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.ped-table th {
    padding: 11px 14px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.ped-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    font-size: 0.85rem;
}

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

.ped-table tbody tr:hover {
    background: rgba(140, 82, 255, 0.05);
}

.ped-col-id {
    width: 64px;
}

.ped-col-num {
    width: 110px;
}

.ped-id {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #c4b5fd;
}

.ped-slot strong {
    font-weight: 600;
    color: var(--text);
}

.ped-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ---------- Generated code ---------- */

.ped-code-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-raised);
    overflow: hidden;
}

.ped-code-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border-color);
}

.ped-code-file {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
}

.ped-code-file::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #8c52ff;
    vertical-align: middle;
}

.ped-code-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(161, 161, 170, 0.8);
}

.ped-code-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ped-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ped-btn:hover {
    border-color: rgba(140, 82, 255, 0.5);
    background: rgba(140, 82, 255, 0.1);
}

.ped-btn:focus-visible {
    outline: 2px solid rgba(140, 82, 255, 0.7);
    outline-offset: 2px;
}

.ped-btn-small {
    padding: 6px 11px;
    font-size: 0.72rem;
}

.ped-btn.is-copied {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.45);
}

.ped-code {
    margin: 0;
    padding: 16px 18px;
    max-height: 420px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    color: #d4d4d8;
    tab-size: 4;
    white-space: pre;
}

/* ---------- Steps ---------- */

.ped-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ped-step {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: var(--background-raised);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.ped-step-num {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: #c4b5fd;
    padding-top: 2px;
}

.ped-step h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.ped-step p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ---------- Note ---------- */

.ped-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 22px;
    padding: 14px 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: rgba(140, 82, 255, 0.06);
    border: 1px solid rgba(140, 82, 255, 0.2);
    border-radius: 8px;
}

.ped-note > i {
    color: #a78bfa;
    margin-top: 3px;
}

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

.ped-note code {
    white-space: nowrap;
}

/* ---------- Toast ---------- */

.ped-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #e9d5ff;
    background: rgba(24, 16, 40, 0.96);
    border: 1px solid rgba(140, 82, 255, 0.45);
    border-radius: 6px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.ped-toast[hidden] {
    display: none !important;
}

.ped-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;
}

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

@media (max-width: 900px) {
    .ped-steps {
        grid-template-columns: minmax(0, 1fr);
    }

}

@media (max-width: 768px) {
    .ped-target {
        align-items: flex-start;
    }

    .ped-target-input {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .ped-code-head {
        padding: 10px 12px;
    }

    .ped-code-actions {
        margin-left: 0;
        width: 100%;
    }

    .ped-code {
        font-size: 0.74rem;
        padding: 12px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ped-btn,
    .ped-input {
        transition: none;
    }
}
