/* Integratsiya bo'limi (webhook, API kalitlar, qo'llanma) — Glass dizayn tizimi ustida.
   Ranglar glass.css o'zgaruvchilaridan (qorong'i/yorug' mavzu). Ochiq portal (_PublicLayout)
   ham shu faylni ishlatadi. Tugma (.btn-save) va boshqa umumiy komponentlar — glass.css'da. */

/* ── Sarlavha + yorliqlar ── */
.int-header {
    border-radius: var(--radius);
    padding: 22px 26px 0;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.22), rgba(212, 165, 116, 0.10)), var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.int-header .top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.int-header h3 {
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.int-header h3 i { color: var(--emerald-light); }
[data-theme="light"] .int-header h3 i { color: var(--emerald); }
.int-header .sub { color: var(--text-secondary); font-size: .9rem; max-width: 760px; }
.int-header .btn-new {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-light));
    border: 0;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.25);
    transition: all var(--t-fast);
}
.int-header .btn-new:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(5, 150, 105, 0.35); color: #fff; }

.int-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.int-tabs a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 12px 12px 0 0;
    font-weight: 500;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all var(--t-fast);
}
.int-tabs a:hover { color: var(--text-primary); background: var(--glass-hover); }
.int-tabs a.active { color: var(--text-primary); background: var(--glass-hover); border-bottom-color: var(--emerald-light); }

/* ── Kartochkalar ── */
.int-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 20px;
    color: var(--text-primary);
    position: relative;
}
.int-card h5 { font-weight: 600; margin-bottom: 4px; }
.int-card .hint { color: var(--text-muted); font-size: .86rem; }
.int-card .table { --bs-table-bg: transparent; }

.int-flash {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--success);
    color: var(--text-primary);
    margin-bottom: 20px;
}
.int-flash > i { color: var(--success); font-size: 1.2rem; }
.int-flash.warn { border-left-color: var(--warning); }
.int-flash.warn > i { color: var(--warning); }

/* ── Ro'yxat jadvali ── */
.int-table { margin: 0; }
.int-table td { vertical-align: middle; }
.int-table tr.clickable { cursor: pointer; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.pill.on { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.pill.off { background: var(--glass-hover); color: var(--text-muted); }
.pill.bad { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.pill.wait { background: rgba(234, 179, 8, 0.15); color: var(--warning); }
.pill.dom { background: rgba(212, 165, 116, 0.15); color: var(--gold); }
[data-theme="light"] .pill.bad { color: #dc2626; }
[data-theme="light"] .pill.dom { color: var(--amber); }

.url-code { font-family: var(--font-mono); font-size: .78rem; color: var(--text-secondary); word-break: break-all; }

/* ── Bo'sh holat ── */
.int-empty { text-align: center; padding: 36px 16px; }
.int-empty .ico {
    width: 64px; height: 64px; border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--emerald), var(--gold));
    color: #fff; font-size: 1.8rem; margin-bottom: 14px;
    box-shadow: 0 12px 36px rgba(5, 150, 105, 0.3);
}
.int-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 22px 0 6px; text-align: left; }
.int-steps .st { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 14px 16px; color: var(--text-secondary); font-size: .9rem; }
.int-steps .st b { display: block; color: var(--text-primary); margin-bottom: 4px; }
.int-steps .st .n {
    display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-light)); color: #fff; font-size: .75rem; font-weight: 700;
    align-items: center; justify-content: center; margin-bottom: 8px;
}

/* ── Forma ── */
.f-group { margin-bottom: 22px; }
.f-group > label, .f-label { font-weight: 500; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.f-group > label i, .f-label i { margin-right: 6px; color: var(--emerald-light); }
[data-theme="light"] .f-group > label i, [data-theme="light"] .f-label i { color: var(--emerald); }
.f-help { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.f-group .text-danger { font-size: 12.5px; }
.btn-soft { border-radius: var(--radius-sm); padding: 10px 20px; font-weight: 500; }

/* ── Ko'lam tanlagichi ── */
.scope-picker .step { margin-bottom: 20px; }
.scope-picker .step-title { font-weight: 600; font-size: .88rem; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.scope-picker .step-title .n {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-light)); color: #fff;
    font-size: .72rem; display: inline-flex; align-items: center; justify-content: center;
}

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--glass-bg);
    transition: all var(--t-fast);
    position: relative;
    user-select: none;
}
.choice:hover { border-color: rgba(52, 211, 153, 0.5); background: var(--glass-hover); }
.choice.sel { border-color: var(--emerald-light); background: rgba(52, 211, 153, 0.1); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.choice.dis { opacity: .4; cursor: not-allowed; }
.choice i { font-size: 1.3rem; color: var(--emerald-light); }
[data-theme="light"] .choice i { color: var(--emerald); }
.choice b { display: block; margin-top: 6px; color: var(--text-primary); font-weight: 600; }
.choice small { color: var(--text-muted); line-height: 1.3; display: block; margin-top: 2px; }

.scope-summary {
    border-radius: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(212, 165, 116, 0.08));
    border: 1px dashed rgba(52, 211, 153, 0.45);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.scope-summary i { font-size: 1.4rem; color: var(--emerald-light); }
.scope-summary .t { font-weight: 600; color: var(--text-primary); }
.scope-summary .d { font-size: .86rem; color: var(--text-secondary); }
.scope-summary.empty { background: rgba(234, 179, 8, 0.08); border-color: rgba(234, 179, 8, 0.5); }
.scope-summary.empty i { color: var(--warning); }
[data-theme="light"] .scope-summary i { color: var(--emerald); }

/* ── Qo'llanma ── */
.guide-nav { position: sticky; top: 16px; }
.guide-nav a {
    display: block; padding: 8px 12px; border-radius: 10px; color: var(--text-secondary);
    text-decoration: none; font-size: .9rem; font-weight: 500;
}
.guide-nav a:hover { background: var(--glass-hover); color: var(--text-primary); }
.guide-nav .grp { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 700; margin: 14px 12px 4px; }

.guide h4 { font-weight: 600; margin-bottom: 12px; scroll-margin-top: 16px; }
.guide h6 { font-weight: 600; margin-top: 18px; }
.guide p, .guide li { color: var(--text-secondary); }
.guide pre {
    background: #0b1410; color: #e2e8f0; border-radius: 12px; padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--font-mono);
    font-size: .78rem; overflow-x: auto; margin: 0;
}
[data-theme="light"] .guide pre { background: #12201a; }
.guide code { color: var(--bs-code-color); }
.guide pre code { color: inherit; }
.guide .tbl { font-size: .86rem; }
.guide .tbl td, .guide .tbl th { padding: 9px 10px; }

.flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.flow .box { flex: 1 1 140px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px 14px; text-align: center; font-size: .85rem; color: var(--text-secondary); }
.flow .box i { display: block; font-size: 1.4rem; color: var(--emerald-light); margin-bottom: 6px; }
[data-theme="light"] .flow .box i { color: var(--emerald); }
.flow .arr { align-self: center; color: var(--text-muted); }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.compare .c { border: 1px solid var(--glass-border); background: var(--glass-bg); border-radius: 14px; padding: 16px 18px; }
.compare .c h6 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.compare .c ul { padding-left: 18px; margin-bottom: 0; font-size: .88rem; }
.compare .text-primary { color: var(--emerald-light) !important; }

body.glass .code-tabs .nav-link,
.code-tabs .nav-link { border-radius: 10px 10px 0 0; font-size: .85rem; font-weight: 600; color: var(--text-secondary); border: 0; }
body.glass .code-tabs .nav-link.active,
.code-tabs .nav-link.active { background: #0b1410; color: #fff; border: 0; }
[data-theme="light"] .code-tabs .nav-link.active { background: #12201a; }

/* ── Qo'llanma bo'limlari: Umumiy / Webhook / Ochiq API ──
   Har bo'lim o'z rangida: umumiy — oltin, webhook — emerald, API — ko'k. */
.guide { --wh: #34d399; --wh2: #059669; --ap: #38bdf8; --ap2: #2563eb; --gn: #d4a574; --gn2: #b45309; }
[data-theme="light"] .guide { --wh: #10b981; --ap: #0ea5e9; }

.guide-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    scroll-margin-top: 90px;
}
.guide-switch a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--t-fast);
}
.guide-switch a:hover { border-color: var(--text-muted); transform: translateY(-1px); }
.guide-switch a > i {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem; background: rgba(212, 165, 116, .14); color: var(--gn);
}
.guide-switch a b { display: block; font-size: 1rem; color: var(--text-primary); font-weight: 600; }
.guide-switch a small { color: var(--text-muted); font-size: .8rem; }
.guide-switch a.wh > i { color: var(--wh); background: rgba(52, 211, 153, .14); }
.guide-switch a.ap > i { color: var(--ap); background: rgba(56, 189, 248, .14); }

.guide-switch a.active { border-color: var(--gn); box-shadow: 0 0 0 3px rgba(212, 165, 116, .18); }
.guide-switch a.active > i { background: linear-gradient(135deg, var(--gn), var(--gn2)); color: #fff; }
.guide-switch a.wh.active { border-color: var(--wh); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.guide-switch a.wh.active > i { background: linear-gradient(135deg, var(--wh), var(--wh2)); color: #fff; }
.guide-switch a.ap.active { border-color: var(--ap); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
.guide-switch a.ap.active > i { background: linear-gradient(135deg, var(--ap), var(--ap2)); color: #fff; }

.guide-banner {
    display: flex;
    gap: 16px;
    align-items: center;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 20px;
    color: #fff;
    scroll-margin-top: 90px;
    background: linear-gradient(135deg, var(--gn), var(--gn2));
}
.guide-banner > i { font-size: 1.8rem; opacity: .95; }
.guide-banner .t { font-weight: 700; font-size: 1.25rem; letter-spacing: -.3px; }
.guide-banner .d { opacity: .9; font-size: .9rem; }
.guide-banner.wh { background: linear-gradient(135deg, var(--wh2), var(--wh)); }
.guide-banner.ap { background: linear-gradient(135deg, var(--ap2), var(--ap)); }
.guide-pane { scroll-margin-top: 90px; }

/* Bo'lim ichidagi kartochkalar — chap chiziq bo'lim rangida */
.guide-pane.gn .int-card:not(.guide-nav) { border-left: 4px solid var(--gn); }
.guide-pane.wh .int-card:not(.guide-nav) { border-left: 4px solid var(--wh); }
.guide-pane.ap .int-card:not(.guide-nav) { border-left: 4px solid var(--ap); }
.guide-pane.wh h4 { color: var(--wh); }
.guide-pane.ap h4 { color: var(--ap); }
[data-theme="light"] .guide-pane.wh h4 { color: var(--wh2); }
[data-theme="light"] .guide-pane.ap h4 { color: var(--ap2); }
.guide-pane.wh .guide-nav a:hover { background: rgba(52, 211, 153, .12); }
.guide-pane.ap .guide-nav a:hover { background: rgba(56, 189, 248, .12); }

.guide-go {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem;
    text-decoration: none; color: #fff;
}
.guide-go.wh { background: linear-gradient(135deg, var(--wh2), var(--wh)); }
.guide-go.ap { background: linear-gradient(135deg, var(--ap2), var(--ap)); }
.guide-go:hover { color: #fff; filter: brightness(1.08); }

@media (max-width: 768px) {
    .guide-switch { grid-template-columns: 1fr; }
    .int-header { padding: 18px 16px 0; }
    .int-card { padding: 18px 16px; }
    .guide-nav { position: static; margin-bottom: 16px; }
}
