/* API Playground (API ToolBox page, EN + HE) */

.pn-tools .pn-page-head {
    margin-bottom: 28px;
}

/* ---------- API key bar ---------- */
.pg-key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 24px;
    padding: 12px 16px;
    border-radius: var(--pn-radius);
    background: var(--pn-mint-tint);
    border: 1px solid #CDEBDD;
    color: var(--pn-mint-ink);
}

.pg-key__input {
    flex: 1 1 280px;
    min-width: 0;
    font-family: var(--pn-font-mono) !important;
    font-size: 14px !important;
}

/* Hebrew placeholder reads right-to-left, the key itself stays LTR */
[dir="rtl"] .pg-key__input:placeholder-shown {
    direction: rtl;
    font-family: var(--pn-font-he) !important;
}

.pg-key__status {
    font-size: 14px;
    font-weight: 600;
}

.pg-key__get {
    font-size: 14px;
    font-weight: 600;
}

.pg-btn-outline {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #A9CDB9;
    border-radius: var(--pn-radius-sm);
    background: var(--pn-surface);
    color: var(--pn-midnight);
    font-size: 14px;
    font-weight: 600;
}

    .pg-btn-outline:hover {
        border-color: var(--pn-midnight);
    }

.pg-btn-sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-color: #C9D5DE;
}

/* ---------- Layout ---------- */
.pg {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}

.pg-side {
    flex: 1 1 260px;
    max-width: 100%;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 14px;
    border-radius: var(--pn-radius);
    background: var(--pn-canvas);
    border: 1px solid var(--pn-border);
}

.pg-main {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 860px) {
    .pg-side {
        position: static;
        max-height: 340px;
    }
}

/* ---------- Sidebar ---------- */
.pg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    padding: 0 12px;
    border: 1px solid #C9D5DE;
    border-radius: var(--pn-radius-sm);
    background: var(--pn-surface);
    color: var(--pn-muted);
}

    .pg-search input {
        flex: 1;
        min-width: 0;
        min-height: 42px;
        padding: 0;
        border: 0 !important;
        outline: 0 !important;
        background: transparent;
        font-size: 15px;
    }

    .pg-search:focus-within {
        outline: 2px solid var(--pn-teal);
        border-color: var(--pn-teal);
    }

.pg-group {
    margin-top: 10px;
}

.pg-group__title {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pn-muted);
}

.pg-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border-radius: var(--pn-radius-sm);
    color: var(--pn-text);
    text-decoration: none;
}

    .pg-item:hover {
        background: var(--pn-surface);
        color: var(--pn-midnight);
    }

    .pg-item.is-active {
        background: var(--pn-surface);
        box-shadow: inset 3px 0 0 var(--pn-teal);
    }

[dir="rtl"] .pg-item.is-active {
    box-shadow: inset -3px 0 0 var(--pn-teal);
}

.pg-item.is-active .pg-item__name {
    color: var(--pn-midnight);
    font-weight: 600;
}

.pg-item__name {
    font-size: 15px;
}

.pg-item__path {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--pn-font-mono);
    font-size: 11px;
    color: #6B7C8A;
    text-align: left;
}

    .pg-item__path .pg-method {
        margin-right: 6px;
    }

[dir="rtl"] .pg-item__path {
    text-align: right;
}

.pg-method {
    flex: none;
    display: inline-block;
    min-width: 44px;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--pn-font-mono);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.pg-method--GET {
    background: #E3F4EA;
    color: var(--pn-mint-ink);
}

.pg-method--POST {
    background: #FDF0E1;
    color: #8A4F0E;
}

.pg-empty,
.pg-placeholder {
    margin: 0;
    padding: 4px 0;
    font-size: 14px;
    color: var(--pn-muted);
}

.pg-side .pg-empty {
    padding: 12px;
}

/* ---------- Request card ---------- */
.pg-card {
    border-radius: var(--pn-radius);
    border: 1px solid var(--pn-border);
    background: var(--pn-surface);
}

.pg-request {
    padding: 28px;
    box-shadow: var(--pn-shadow);
}

.pg-request__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.pg-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pn-teal);
}

.pg-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pn-teal);
    font-size: 13px;
    font-weight: 600;
}

    .pg-link .pn-icon {
        width: 15px;
        height: 15px;
    }

    .pg-link:hover {
        color: var(--pn-teal-dark);
        text-decoration: underline;
    }

.pg-title {
    margin: 6px 0 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

[dir="rtl"] .pg-title {
    letter-spacing: 0;
}

.pg-desc {
    margin: 4px 0 0;
    color: var(--pn-muted);
}

.pg-url {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    padding: 10px 14px;
    overflow-x: auto;
    border-radius: var(--pn-radius-sm);
    background: var(--pn-canvas);
    border: 1px solid var(--pn-border-soft);
    font-family: var(--pn-font-mono);
    font-size: 14px;
    white-space: nowrap;
}

.pg-url .pg-method {
    margin-right: 10px;
}

.pg-url__base {
    color: var(--pn-muted);
}

.pg-url__path {
    color: var(--pn-midnight);
    font-weight: 500;
}

.pg-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.pg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pg-field__label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    font-size: 14px;
}

.pg-field__name {
    font-family: var(--pn-font-mono);
    font-weight: 600;
    color: var(--pn-midnight);
}

.pg-field__hint {
    color: #6B7C8A;
}

.pg-input {
    width: 100%;
}

.pg-input--mono {
    min-height: 100px;
    font-family: var(--pn-font-mono) !important;
    font-size: 14px !important;
    resize: vertical;
}

.pg-file {
    width: 100%;
    padding: 14px;
    border: 1.5px dashed #A9BAC7;
    border-radius: var(--pn-radius-sm);
    background: #FAFCFD;
    font-size: 14px;
    color: var(--pn-muted);
}

    .pg-file::file-selector-button {
        margin-inline-end: 12px;
        min-height: 36px;
        padding: 0 14px;
        border: 1px solid #C9D5DE;
        border-radius: 6px;
        background: var(--pn-surface);
        color: var(--pn-midnight);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

.pg-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 22px;
}

    .pg-actions .pn-btn:disabled {
        opacity: .7;
        cursor: progress;
    }

.pg-hint {
    font-size: 13px;
    color: #6B7C8A;
}

.pg-error {
    font-size: 14px;
    font-weight: 600;
    color: #B42318;
}

/* ---------- Response ---------- */
.pg-response {
    overflow: hidden;
    background: var(--pn-canvas);
}

.pg-response__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--pn-border);
    background: var(--pn-surface);
}

.pg-response__title {
    font-weight: 700;
    color: var(--pn-midnight);
}

.pg-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

    .pg-status::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: currentColor;
    }

    .pg-status.is-ok {
        background: #E3F4EA;
        color: #11603F;
    }

    .pg-status.is-bad {
        background: #FDECEA;
        color: #B42318;
    }

.pg-meta {
    font-size: 13px;
    color: var(--pn-muted);
}

.pg-spacer {
    flex: 1;
}

#pg-response-body {
    padding: 18px 20px;
}

.pg-body {
    margin: 0;
    max-height: 420px;
    overflow: auto;
    padding: 0;
    background: none;
    color: var(--pn-midnight);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.pg-file-result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.pg-file-result__preview {
    min-width: 96px;
    max-width: 160px;
    max-height: 160px;
    padding: 6px;
    border: 1px solid var(--pn-border);
    border-radius: var(--pn-radius-sm);
    background: var(--pn-surface);
}

.pg-file-result__icon {
    width: 72px;
    height: 88px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    border-radius: var(--pn-radius-sm);
    border: 1px solid var(--pn-border);
    background: var(--pn-surface);
    font-family: var(--pn-font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #8A4F0E;
}

.pg-file-result__info {
    flex: 1 1 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .pg-file-result__info strong {
        color: var(--pn-midnight);
        overflow-wrap: anywhere;
    }

    .pg-file-result__info span {
        font-size: 14px;
        color: var(--pn-muted);
    }

/* ---------- Code snippets ---------- */
.pg-code {
    border-radius: var(--pn-radius);
    background: var(--pn-midnight-deep);
    overflow: hidden;
    text-align: left;
}

.pg-code__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    border-bottom: 1px solid #2A4259;
}

.pg-tabs {
    display: flex;
    flex-wrap: wrap;
}

.pg-tab {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #8FA9BC;
    font-size: 14px;
    font-weight: 600;
}

    .pg-tab:hover {
        color: #FFFFFF;
    }

    .pg-tab[aria-selected="true"] {
        color: #FFFFFF;
        border-bottom-color: var(--pn-mint);
    }

.pg-btn-dark {
    min-height: 32px;
    margin: 6px 0;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
}

    .pg-btn-dark:hover {
        background: rgba(255, 255, 255, .18);
    }

.pg-code pre {
    margin: 0;
    padding: 20px 22px;
    border-radius: 0;
    background: none;
    color: #D5E7ED;
    font-size: 13px;
    line-height: 1.75;
    white-space: pre;
    overflow-x: auto;
}

.pg-code__note {
    margin: 0;
    padding: 10px 22px 14px;
    border-top: 1px solid #2A4259;
    font-size: 13px;
    color: #F2C98B;
}
