/* ═══════════════════════════════════════════════
   BİLGİ BANKASI  —  kb-* prefix
   ═══════════════════════════════════════════════ */

.kb-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Hero ─────────────────────────────────────── */
.kb-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 32px 40px;
    background: linear-gradient(135deg, #1e3557 0%, #365989 55%, #5a8fc7 100%);
    border-radius: 22px;
    color: #fff;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.kb-hero::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -90px; right: -60px;
    pointer-events: none;
}

.kb-hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.kb-hero-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.kb-hero-icon {
    font-size: 36px;
    width: 70px; height: 70px;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.kb-eyebrow {
    font-size: 10px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
    opacity: .72; font-family: var(--font-mono, monospace);
    margin-bottom: 4px;
}

.kb-hero-title {
    font-size: clamp(18px, 2.2vw, 26px);
    font-weight: 800; line-height: 1.2;
    letter-spacing: -.02em; margin: 0 0 4px;
}

.kb-hero-sub { font-size: 13px; opacity: .8; margin: 0; }

/* Search */
.kb-search-form { display: flex; gap: 6px; }
.kb-search-input {
    padding: 9px 14px;
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 10px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 13.5px; width: 240px;
    outline: none;
    backdrop-filter: blur(4px);
    transition: background .15s, border-color .15s;
}
.kb-search-input::placeholder { color: rgba(255,255,255,.65); }
.kb-search-input:focus { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.6); }
.kb-search-btn {
    padding: 9px 14px;
    background: rgba(255,255,255,.2);
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 10px;
    color: #fff; font-size: 15px; cursor: pointer;
    transition: background .15s;
}
.kb-search-btn:hover { background: rgba(255,255,255,.3); }

.kb-write-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    background: rgba(255,255,255,.95);
    color: #1e3557;
    border-radius: 10px;
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.kb-write-btn:hover { background: #fff; text-decoration: none; color: #1e3557; }

/* ── Şirket Seçim Bar ───────────────────────── */
.kb-company-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    flex-wrap: wrap;
}

.kb-company-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.kb-company-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.kb-company-chip {
    display: inline-flex; align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px; font-weight: 800;
    color: #374151; text-decoration: none;
    letter-spacing: .04em;
    transition: all .15s;
    font-family: var(--font-mono, monospace);
}
.kb-company-chip:hover {
    border-color: #365989; color: #365989;
    background: rgba(54,89,137,.05);
    text-decoration: none;
}
.kb-company-chip.is-active {
    background: #1e3557; border-color: #1e3557;
    color: #fff;
}

/* ── Birim Filtre Chips ─────────────────────── */
.kb-unit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 12.5px; font-weight: 700;
    color: #374151; text-decoration: none;
    transition: all .15s;
}
.kb-chip:hover          { border-color: #365989; color: #365989; text-decoration: none; }
.kb-chip.is-active      { background: #1e3557; border-color: #1e3557; color: #fff; }

/* ── Arama bilgisi ──────────────────────────── */
.kb-search-info {
    padding: 10px 16px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    font-size: 13px; color: #1e40af;
}
.kb-search-info a { color: #1e40af; font-weight: 700; }

/* ── Makale Kartları ────────────────────────── */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.kb-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 22px;
    display: flex; flex-direction: column; gap: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .13s;
}
.kb-card:hover {
    border-color: #365989;
    box-shadow: 0 4px 20px rgba(54,89,137,.12);
    transform: translateY(-2px);
}

.kb-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.kb-unit-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    background: rgba(54,89,137,.08);
    border-radius: 6px;
    font-size: 11px; font-weight: 700; color: #365989;
}
.kb-unit-badge.is-general {
    background: rgba(107,114,128,.08);
    color: #6b7280;
}

.kb-view-count { font-size: 11px; color: #9ca3af; }

.kb-card-title {
    font-size: 15px; font-weight: 800;
    color: #111827; line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card-summary {
    font-size: 12.5px; color: #6b7280;
    line-height: 1.55; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.kb-tag {
    display: inline-flex;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 5px;
    font-size: 11px; font-weight: 600; color: #374151;
}

.kb-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto;
    font-size: 11px; color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
}

.kb-empty {
    display: flex; flex-direction: column; align-items: center;
    padding: 60px 20px;
    background: #fff;
    border: 1.5px dashed #e5e7eb;
    border-radius: 16px;
    text-align: center;
    gap: 10px;
}
.kb-empty-icon { font-size: 40px; }
.kb-empty-text { font-size: 15px; font-weight: 700; color: #6b7280; }

/* ── Detail Page ────────────────────────────── */
.kb-detail-page {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

/* Sticky nav */
.kb-detail-nav {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    position: sticky; top: 12px; z-index: 50;
    background: rgba(248,250,253,.92);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(229,231,235,.8);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Header card */
.kb-detail-header {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 32px 36px 28px;
    display: flex; flex-direction: column; gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(54,89,137,.06);
}
.kb-detail-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #1e3557, #365989, #5a8fc7);
    border-radius: 20px 20px 0 0;
}

.kb-detail-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800; line-height: 1.25;
    color: #0f172a; margin: 0;
    letter-spacing: -.02em;
}

.kb-detail-summary {
    font-size: 15.5px; color: #4b5563;
    line-height: 1.65; margin: 0;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border-left: 4px solid #365989;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
}

/* Meta pills */
.kb-detail-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 12px;
}
.kb-meta-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b; font-weight: 600;
    white-space: nowrap;
}
.kb-sep { display: none; }

/* Content body */
.kb-detail-body {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 32px 36px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

/* Prose typography */
.kb-content {
    font-size: 15.5px; line-height: 1.8;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}
.kb-content h1, .kb-content h2, .kb-content h3,
.kb-content h4, .kb-content h5, .kb-content h6 {
    color: #0f172a; font-weight: 800;
    line-height: 1.3; margin: 1.4em 0 .5em;
}
.kb-content h1 { font-size: 1.7em; }
.kb-content h2 { font-size: 1.4em; border-bottom: 1.5px solid #e5e7eb; padding-bottom: .4em; }
.kb-content h3 { font-size: 1.2em; }
.kb-content p  { margin: 0 0 1em; }
.kb-content ul, .kb-content ol {
    margin: .5em 0 1em; padding-left: 1.6em;
}
.kb-content li { margin-bottom: .3em; }
.kb-content a  { color: #365989; text-decoration: underline; }
.kb-content a:hover { color: #1e3557; }
.kb-content code {
    background: #f1f5f9; color: #be185d;
    padding: 2px 6px; border-radius: 5px;
    font-size: .88em; font-family: monospace;
}
.kb-content pre {
    background: #1e293b; color: #e2e8f0;
    padding: 18px 20px; border-radius: 12px;
    overflow-x: auto; font-size: 13.5px; line-height: 1.6;
    margin: 1em 0;
}
.kb-content pre code { background: none; color: inherit; padding: 0; }
.kb-content blockquote {
    border-left: 4px solid #365989;
    background: #eff6ff;
    margin: 1em 0; padding: 12px 18px;
    border-radius: 0 10px 10px 0;
    color: #374151; font-style: italic;
}
.kb-content table {
    width: 100%; border-collapse: collapse; margin: 1em 0;
    font-size: 14px;
}
.kb-content th {
    background: #f8fafd; font-weight: 700;
    padding: 10px 14px; text-align: left;
    border: 1px solid #e5e7eb;
}
.kb-content td {
    padding: 9px 14px; border: 1px solid #e5e7eb;
}
.kb-content tr:nth-child(even) td { background: #fafbfc; }
.kb-content hr {
    border: none; border-top: 1.5px solid #e5e7eb;
    margin: 1.5em 0;
}
.kb-content img {
    max-width: 100%; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
}

.kb-detail-foot { padding-bottom: 8px; }

.kb-btn-del { color: #dc2626 !important; border-color: #fecaca !important; }
.kb-btn-del:hover { background: #fef2f2 !important; }

/* ── Write / Edit Page ─────────────────────── */
.kb-write-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 36px;
    background: linear-gradient(135deg, #1e3557 0%, #365989 60%, #5a8fc7 100%);
    border-radius: 22px;
    color: #fff;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.kb-write-hero::before {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -60px; right: -40px;
}
.kb-write-hero-title {
    font-size: 20px; font-weight: 800;
    line-height: 1.25; max-width: 520px;
}

.kb-form-card {
    background: #fff;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
}
.kb-form-head {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 28px 16px;
    border-bottom: 1.5px solid #f3f4f6;
    background: #fafafa;
}
.kb-form-head-icon {
    font-size: 22px; width: 42px; height: 42px;
    background: #e0f2fe; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.kb-card-label {
    font-size: 10px; font-weight: 800; color: #6b7280;
    text-transform: uppercase; letter-spacing: .08em;
    font-family: var(--font-mono, monospace);
}
.kb-card-title { font-size: 14px; font-weight: 700; color: #111827; margin-top: 3px; }

.kb-form-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }

.kb-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kb-field      { display: flex; flex-direction: column; gap: 6px; }

.kb-label    { font-size: 12.5px; font-weight: 700; color: #374151; }
.kb-required { color: #dc2626; margin-left: 2px; }
.kb-hint     { font-size: 11px; color: #9ca3af; }
.kb-field-error { font-size: 11.5px; color: #dc2626; }

.kb-input,
.kb-select {
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13.5px;
    outline: none;
    background: #f9fafb;
    width: 100%;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.kb-input:focus,
.kb-select:focus {
    border-color: #365989;
    box-shadow: 0 0 0 3px rgba(54,89,137,.12);
    background: #fff;
}
.kb-textarea       { resize: vertical; min-height: 80px; }
.kb-content-area   { min-height: 240px; font-size: 14px; line-height: 1.7; }

.kb-readonly-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    background: #f3f4f6; border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    font-size: 13px; color: #374151; font-weight: 600;
}

.kb-validation-summary {
    background: #fef2f2; border: 1.5px solid #fecaca;
    border-radius: 10px; padding: 12px 16px;
    font-size: 13px; color: #dc2626;
}

/* Toggle */
.kb-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border: 1.5px solid #e5e7eb; border-radius: 12px;
    background: #f9fafb; cursor: pointer;
    transition: border-color .2s, background .2s; gap: 14px;
    max-width: 360px;
}
.kb-toggle-row.is-active { border-color: #86efac; background: #f0fdf4; }
.kb-toggle-info  { display: flex; flex-direction: column; gap: 2px; }
.kb-toggle-label { font-size: 13px; font-weight: 700; color: #374151; }
.kb-toggle-desc  { font-size: 11.5px; color: #9ca3af; }
.kb-toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.kb-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.kb-toggle-slider {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 99px;
    cursor: pointer; transition: background .22s;
}
.kb-toggle-slider::before {
    content: '';
    position: absolute; left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .22s;
}
.kb-toggle-switch input:checked + .kb-toggle-slider { background: #16a34a; }
.kb-toggle-switch input:checked + .kb-toggle-slider::before { transform: translateX(20px); }

/* Form Footer */
.kb-form-footer {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 28px;
    border-top: 1.5px solid #f3f4f6;
    background: #fafafa;
}
.kb-btn-submit {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1e3557, #365989);
    color: #fff; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,53,87,.3);
    transition: all .18s;
}
.kb-btn-submit:hover {
    background: linear-gradient(135deg, #152840, #1e3557);
    transform: translateY(-1px);
}
.kb-btn-cancel {
    display: inline-flex; align-items: center;
    padding: 9px 18px;
    background: #f3f4f6; color: #374151;
    border: 1.5px solid #e5e7eb; border-radius: 10px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all .15s;
}
.kb-btn-cancel:hover { background: #e5e7eb; text-decoration: none; }

/* ── Reading Progress Bar ───────────────────── */
.kb-read-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}
.kb-read-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1e3557 0%, #5a8fc7 100%);
    transition: width .12s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Back To Top ────────────────────────────── */
.kb-back-top {
    position: fixed;
    bottom: 28px; right: 24px;
    width: 46px; height: 46px;
    background: #1e3557;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 18px rgba(30,53,87,.35);
    opacity: 0;
    transform: translateY(12px) scale(.9);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    z-index: 400;
}
.kb-back-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.kb-back-top:hover {
    background: #365989;
    box-shadow: 0 6px 24px rgba(30,53,87,.4);
    transform: translateY(-2px) scale(1);
}

/* ── Reading time pill ──────────────────────── */
.kb-reading-time {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px;
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 700;
    color: #1e40af;
    white-space: nowrap;
}

/* ── Detail header (enhanced) ───────────────── */
.kb-detail-header {
    background: linear-gradient(145deg, #f8faff 0%, #eff4ff 60%, #f0f9ff 100%);
    border: 1.5px solid #dbeafe;
}
.kb-detail-header::before {
    height: 5px;
    background: linear-gradient(90deg, #1e3557, #365989 50%, #5a8fc7 100%);
}

/* ── Public article notice ───────────────────── */
.kb-public-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
    .kb-detail-page { max-width: 100%; padding: 0 4px; }
}

@media (max-width: 700px) {
    .kb-hero          { padding: 20px 18px; flex-direction: column; align-items: flex-start; gap: 16px; }
    .kb-hero-right    { width: 100%; }
    .kb-search-form   { width: 100%; }
    .kb-search-input  { width: 1px; flex: 1; }
    .kb-grid          { grid-template-columns: 1fr; }
    .kb-field-row     { grid-template-columns: 1fr; }
    .kb-form-body     { padding: 18px 16px; }
    .kb-form-head     { padding: 16px 18px 14px; }
    .kb-form-footer   { padding: 14px 18px; }
    .kb-detail-page   { gap: 14px; }
    .kb-detail-header { padding: 20px 18px; }
    .kb-detail-body   { padding: 20px 18px; }
    .kb-detail-title  { font-size: clamp(18px, 5vw, 24px); }
    .kb-detail-nav    { gap: 8px; }
    .kb-detail-nav > div { flex-wrap: wrap; }
    .kb-detail-meta   { font-size: 11.5px; gap: 6px; }
    .kb-detail-album  { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .kb-company-bar   { padding: 10px 12px; }
    .kb-write-hero    { padding: 22px 20px; }
}

@media (max-width: 480px) {
    .kb-hero          { padding: 16px 16px; }
    .kb-detail-header { padding: 16px 14px; }
    .kb-detail-body   { padding: 16px 14px; }
    .kb-content       { font-size: 14px; }
    .kb-detail-nav    { flex-direction: column; align-items: flex-start; }
    .kb-detail-nav > div { width: 100%; }
    .kb-detail-nav > div .btn { flex: 1; text-align: center; justify-content: center; }
    .kb-detail-album  { grid-template-columns: repeat(3, 1fr); }
    .kb-unit-chips    { gap: 6px; }
    .kb-chip          { padding: 5px 11px; font-size: 12px; }
    .kb-write-hero    { padding: 18px 16px; }
    .kb-write-hero-title { font-size: 16px; }
}
