/* ============================================================
   Analiz Rehberi — frontend/styles/pages/rehber.css
   Tasarım sistemi değişkenlerine dayanır (variables.css)
   ============================================================ */

.view-rehber {
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
}

.view-rehber .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md, 1rem);
  padding: var(--space-md, 1rem) var(--page-gutter, 1.5rem);
  min-height: var(--size-header-bar, 3.25rem);
  background: var(--surface);
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.view-rehber .page-header .header-left,
.view-rehber .page-header .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md, 1rem);
  min-width: 0;
}

.view-rehber .page-header .header-right {
  flex-shrink: 0;
}

.view-rehber .page-header h1 {
  margin: 0;
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.view-rehber .rehber-header-icon-svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  display: block;
  flex-shrink: 0;
}

/* ── Arama kutusu ─────────────────────────────────────────── */
.rehber-search-input {
  padding: 0.45rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full, 999px);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  width: min(220px, 100%);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.rehber-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 99 102 241), 0.18);
}
.rehber-search-input::placeholder { color: var(--text-muted); }

/* ── Sayfa gövdesi ─────────────────────────────────────────── */
.rehber-page {
  padding: var(--space-lg, 1.5rem) var(--page-gutter, 1.5rem) 4rem;
  max-width: var(--content-max-w, 1280px);
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* ── Filtre pill çubuğu ───────────────────────────────────── */
.rehber-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 0.5rem);
  padding-bottom: 0.25rem;
  margin-bottom: var(--space-lg, 1.5rem);
}

.rehber-filter-pill {
  flex-shrink: 0;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full, 999px);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
.rehber-filter-pill:hover { color: var(--text-primary); border-color: var(--accent); }
.rehber-filter-pill.active {
  background: var(--accent);
  color: var(--black, #000);
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Kart ızgarası ────────────────────────────────────────── */
.rehber-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-md, 1rem);
  align-items: stretch;
}

/* ── Kart ────────────────────────────────────────────────── */
.rehber-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-md, 1rem) var(--space-lg, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.75rem);
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.rehber-card:hover {
  border-color: rgba(var(--accent-rgb, 99 102 241), 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

/* ── Kart başlık satırı ───────────────────────────────────── */
.rehber-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}
.rehber-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rehber-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.rehber-card-title {
  margin: 0;
  font-size: var(--text-base, 0.95rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badge'ler ─────────────────────────────────────────────── */
.rehber-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.rehber-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full, 999px);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.rehber-badge--kat      { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.rehber-badge--ucretsiz { background: rgba(34,197,94,0.12);  color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.rehber-badge--premium  { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.rehber-badge--katalog  { background: rgba(var(--accent-rgb,99 102 241),0.1); color: var(--accent); border: 1px solid rgba(var(--accent-rgb,99 102 241),0.25); }

/* ── Özet ─────────────────────────────────────────────────── */
.rehber-card-ozet {
  margin: 0;
  flex: 1 1 auto;
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-muted);
  line-height: 1.55;
  min-height: 4.5em;
}

/* ── Alt bölüm (details + Lab'da Aç) ─────────────────────── */
.rehber-card-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

/* ── Details / Nasıl kullanılır ────────────────────────────── */
.rehber-detail {
  margin: 0;
}
.rehber-detail summary {
  cursor: pointer;
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  padding: 0.15rem 0;
}
.rehber-detail summary::-webkit-details-marker { display: none; }
.rehber-detail summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.2s var(--ease);
  display: inline-block;
  flex-shrink: 0;
}
.rehber-detail[open] summary::before { transform: rotate(90deg); }
.rehber-detail summary:hover { color: var(--accent-hover, var(--accent)); }

.rehber-detail-body {
  padding: var(--space-sm, 0.5rem) 0 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rehber-detail-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
}
.rehber-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 0.1rem;
}
.rehber-detail-val {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ── "Lab'da Aç" butonu ───────────────────────────────────── */
.rehber-open-btn {
  align-self: flex-start;
  margin: 0;
  font-size: var(--text-sm, 0.875rem);
  padding: 0.35rem 0.85rem;
}

/* ── Boş durum ───────────────────────────────────────────── */
.rehber-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: 3rem 1rem;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .rehber-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  }
}

@media (max-width: 640px) {
  .view-rehber .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .view-rehber .page-header .header-right {
    width: 100%;
  }
  .rehber-search-input {
    width: 100%;
  }
  .rehber-grid {
    grid-template-columns: 1fr;
  }
  .rehber-card-ozet {
    min-height: 0;
  }
  .rehber-detail-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .rehber-detail-label {
    margin-bottom: 0.1rem;
  }
}
