/* ==========================================================================
   Faydalı Linkler — ziyaretçi sayfası (/faydali-linkler) ve yönetim paneli
   Ana sayfa "Hızlı Erişim" bloğu bu dosyayı yüklemez; yalnızca style.css sınıflarını kullanır.
   ========================================================================== */

/* ---------- Arama ---------- */
.links-search { max-width: 760px; margin: 0 auto 28px; }
.links-search-box { position: relative; }
.links-search-box > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 1.05rem; }
.links-search-box .form-control { padding-left: 50px; min-height: 56px; border-radius: 14px; box-shadow: var(--shadow-sm); font-size: 1.05rem; }
.links-search-box .form-control::placeholder { color: #8a94a6; }
.links-search-status { text-align: center; color: var(--muted); font-size: .88rem; margin: 8px 0 0; }

/* ---------- Kategori gezinme (mobilde üstte yatay, geniş ekranda solda dikey; ikisi de yapışkan) ---------- */
.links-layout { display: block; }
.links-nav {
  position: sticky; top: var(--links-header-h, 70px); z-index: 1010;
  background: rgba(255, 255, 255, .97); backdrop-filter: saturate(160%) blur(6px);
  margin: 0 calc(var(--bs-gutter-x, 1.5rem) * -.5) 20px; padding: 10px calc(var(--bs-gutter-x, 1.5rem) * .5);
  border-bottom: 1px solid var(--border); box-shadow: 0 6px 12px -10px rgba(14, 42, 71, .25);
}
.links-chip-nav { position: relative; flex-wrap: nowrap; overflow-x: auto; list-style: none; margin: 0; padding: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.links-chip-nav::-webkit-scrollbar { display: none; }
.links-chip-nav > li { flex-shrink: 0; }
.links-chip-nav .chip { white-space: nowrap; font-size: .85rem; padding: 6px 12px; min-height: 36px; }
.links-chip-nav .chip i { color: var(--brand-500); }
.links-chip-nav .chip:hover { text-decoration: none; }
.links-chip-nav .chip.active i { color: var(--accent); }
.links-chip-count { font-size: .72rem; font-weight: 700; line-height: 1.4; background: var(--brand-50); color: var(--brand-700); border-radius: 999px; padding: 0 7px; }
.links-chip-nav .chip.active .links-chip-count { background: rgba(255, 255, 255, .2); color: #fff; }

@media (min-width: 992px) {
  .links-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
  .links-nav {
    top: calc(var(--links-header-h, 70px) + 16px); margin: 0; padding: 0 4px 0 0; background: transparent; backdrop-filter: none;
    border: 0; box-shadow: none; max-height: calc(100vh - var(--links-header-h, 70px) - 32px); overflow-y: auto; scrollbar-width: thin;
  }
  .links-chip-nav { flex-direction: column; overflow: visible; gap: 6px; }
  .links-chip-nav .chip { display: flex; width: 100%; white-space: normal; border-radius: 10px; padding: 8px 12px; line-height: 1.25; }
  .links-chip-label { flex: 1 1 auto; }
  .links-chip-count { margin-left: auto; }
}

/* ---------- Gruplar ---------- */
.links-group { margin-bottom: 40px; scroll-margin-top: var(--links-scroll-offset, 140px); }
.links-group-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.links-group-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); color: var(--accent); font-size: 1.1rem; }
.links-group-title { font-size: clamp(1.15rem, 2vw, 1.4rem); margin: 0; line-height: 1.3; }
.links-group-desc { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.links-featured { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(14px, 3vw, 22px); }
.links-featured .links-group-icon { background: var(--accent-100); color: var(--accent-600); }

/* ---------- Kutucuklar ---------- */
.links-grid, .home-links .tile-grid { list-style: none; padding: 0; margin: 0; }
.links-grid > li { min-width: 0; }
.link-tile { position: relative; }
.link-tile-body { min-width: 0; flex: 1 1 auto; }
.link-tile .tile-title, .link-tile .tile-desc { overflow-wrap: anywhere; }
.link-tile .link-tile-host { margin-top: 6px; font-size: .76rem; font-weight: 600; color: var(--brand-500); }
.link-tile .tile-ext { margin-top: 2px; }
.link-tile:focus-visible { outline: 3px solid rgba(201, 161, 74, .7); outline-offset: 2px; }

.links-empty { border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 32px; }
.links-note { margin-top: 12px; }
.links-domain { font-family: var(--bs-font-monospace); font-size: .88em; background: rgba(255, 255, 255, .7); padding: 0 4px; border-radius: 4px; white-space: nowrap; }

@media (max-width: 575.98px) {
  .links-group { margin-bottom: 32px; }
  .links-group-icon { width: 38px; height: 38px; font-size: 1rem; }
  .links-search-box .form-control { font-size: 1rem; }
}

@media print {
  .links-nav, .links-search { display: none !important; }
  .links-layout { display: block; }
  .link-tile { break-inside: avoid; }
}

/* ==========================================================================
   Yönetim paneli (admin/links.php, admin/link_categories.php)
   ========================================================================== */
.links-admin-stats .stat-card { padding: 10px 14px; }
.links-admin-stats .stat-value { font-size: 1.35rem; margin-top: 2px; }
.links-admin-table td, .links-admin-table th { vertical-align: middle; }
.links-admin-table .links-sort-input { width: 78px; }
.links-admin-table .links-admin-group > th {
  background: #eef3f9 !important; color: var(--brand-900, #0b2239); font-size: .82rem; text-transform: none; letter-spacing: 0;
  border-top: 2px solid #d9e3ef;
}
.links-admin-title { font-weight: 600; }
.links-admin-desc { font-size: .8rem; color: var(--muted); max-width: 420px; }
.links-admin-host { font-size: .84rem; white-space: nowrap; }
.links-admin-final { display: block; font-size: .75rem; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-icon-cell { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; background: #eef3f9; color: #1c4e80; flex-shrink: 0; }
.links-toggle-btn { border: 0; background: transparent; padding: 2px 6px; line-height: 1; border-radius: 6px; }
.links-toggle-btn:focus-visible { outline: 2px solid #1c4e80; outline-offset: 1px; }
.links-star { color: #c3cad5; font-size: 1.05rem; }
.links-star.is-on { color: #c9a14a; }
.links-admin-table tr.links-row-broken > td { background: #fdf1f0; }
.links-admin-table tr.links-row-broken > td:first-child { box-shadow: inset 4px 0 0 #b42318; }
.links-admin-table tr.links-row-warn > td:first-child { box-shadow: inset 4px 0 0 #d4a017; }
.links-admin-table tr.links-row-inactive .links-admin-title { color: var(--muted); }
.links-sort-dirty { border-color: #c9a14a !important; background: #fffaf0; }
.links-icon-preview { min-width: 46px; justify-content: center; }
.links-check-form .btn[disabled] { cursor: progress; }
