/**
 * Kamu Atama TR — Kadro Keşfi Modülü Stilleri (kadro-kesfi.css)
 * ÖSYM gerçek yerleştirme verileriyle çalışan mobil öncelikli arayüz.
 */

/* ==========================================================================
   1. Bilgilendirme ve Rehber Banner (_KadroKesfiRehber)
   ========================================================================== */
.kk-guide-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3479e4;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #1e293b;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kk-guide-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.kk-guide-icon {
  font-size: 20px;
  color: #3479e4;
  margin-top: 2px;
  flex-shrink: 0;
}

.kk-guide-content {
  flex: 1;
}

.kk-guide-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.kk-guide-text {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #475569;
  margin: 0;
}

.kk-guide-dismiss {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.kk-guide-dismiss:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.kk-guide-details {
  margin-top: 12px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
}

.kk-guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.kk-guide-summary::-webkit-details-marker {
  display: none;
}

.kk-guide-arrow {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.kk-guide-details[open] .kk-guide-arrow {
  transform: rotate(180deg);
}

.kk-guide-accordion-body {
  padding-top: 10px;
}

.kk-guide-principles {
  margin: 0;
  padding-left: 20px;
  font-size: 0.825rem;
  line-height: 1.6;
  color: #475569;
}

.kk-guide-principles li {
  margin-bottom: 6px;
}

.kk-guide-principles strong {
  color: #1e293b;
}

/* ==========================================================================
   2. Form Bileşenleri
   ========================================================================== */
.kk-form-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Düzey Radyo Kartları */
.kk-duzey-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kk-duzey-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .kk-duzey-cards {
    grid-template-columns: 1fr;
  }
}

.kk-duzey-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  min-height: 64px;
}

.kk-duzey-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kk-duzey-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.kk-duzey-card.is-selected {
  border-color: #3479e4;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(52, 121, 228, 0.15);
}

.kk-duzey-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.kk-duzey-subtitle {
  font-size: 0.775rem;
  color: #64748b;
  margin-top: 2px;
}

.kk-duzey-note {
  font-size: 0.8125rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.kk-duzey-note a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
}

/* Combobox (Program Seçici) */
.kk-combobox-container {
  position: relative;
}

.kk-combobox-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kk-combobox-input {
  width: 100%;
  padding-right: 36px;
}

.kk-combobox-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.kk-combobox-clear:hover {
  color: #0f172a;
}

.kk-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  z-index: 990;
  list-style: none;
  margin: 0;
  padding: 4px;
}

.kk-dropdown-item {
  padding: 10px 14px;
  font-size: 0.875rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #1e293b;
  min-height: 44px; /* a11y touch target */
}

.kk-dropdown-item:hover,
.kk-dropdown-item.is-focused {
  background: #f1f5f9;
  color: #0f172a;
}

.kk-dropdown-item.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.kk-dropdown-code {
  font-size: 0.775rem;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.kk-dropdown-empty {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
}

/* Segmented Buttons (Teşkilat) */
.kk-segment-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
}

.kk-segment-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: 0.825rem;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.kk-segment-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* İl Seçimi Çipleri */
.kk-city-picker-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kk-city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
  padding: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.kk-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  cursor: pointer;
  user-select: none;
  min-height: 32px;
}

.kk-city-chip.is-active {
  background: #3479e4;
  border-color: #3479e4;
  color: #ffffff;
}

/* Belgeler Onay Kutusu Izgarası (Eski site.css float hatasını çözer!) */
.kk-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
  width: 100%;
}

.kk-cert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 48px;
}

.kk-cert-item:hover {
  border-color: #cbd5e1;
}

.kk-cert-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #3479e4;
  flex-shrink: 0;
}

.kk-cert-text {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #334155;
  flex: 1;
}

.kk-cert-code {
  font-weight: 700;
  color: #0f172a;
  margin-right: 4px;
}

/* Form Butonları */
.kk-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.kk-submit-btn {
  min-height: 48px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
}

.kk-reset-btn {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 0.9rem;
}

/* ==========================================================================
   3. Sonuç Bölümü & Özet Şeridi
   ========================================================================== */
.kk-results-container {
  margin-top: 36px;
}

.kk-summary-bar {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.kk-summary-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Filtre Sekmeleri */
.kk-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.kk-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kk-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 40px;
}

.kk-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.kk-tab-btn.is-active {
  background: #3479e4;
  color: #ffffff;
}

.kk-tab-count {
  font-size: 0.775rem;
  opacity: 0.85;
  margin-left: 4px;
}

.kk-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: #64748b;
}

.kk-sort-select {
  padding: 6px 12px;
  font-size: 0.825rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
}

/* ==========================================================================
   4. Kadro Kartı (.kk-card — Mobil Öncelikli)
   ========================================================================== */
.kk-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kk-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kk-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(10, 25, 60, 0.07);
}

.kk-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kk-card-title-group {
  flex: 1;
}

.kk-card-kurum {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #3479e4;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.kk-card-unvan {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.3;
}

.kk-card-location-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.8125rem;
  color: #475569;
}

.kk-card-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Rozetler */
.kk-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 600;
}

.kk-badge-uygun {
  background: #dcfce7;
  color: #166534;
}

.kk-badge-kontrol {
  background: #fef3c7;
  color: #92400e;
}

.kk-badge-uygun-degil {
  background: #fee2e2;
  color: #991b1b;
}

.kk-why-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  text-decoration: underline;
  margin-left: 4px;
}

.kk-why-panel {
  margin-top: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #334155;
}

/* Belge Rozetleri */
.kk-doc-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
}

.kk-doc-var {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.kk-doc-eksik {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.kk-doc-kontrol {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Metrik Satırı */
.kk-card-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 16px;
}

.kk-metric-stat {
  display: flex;
  flex-direction: column;
}

.kk-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 2px;
}

.kk-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.kk-stat-highlight {
  font-size: 1.15rem;
  color: #1e3a8a;
}

/* Mini Trend / Sparkline */
.kk-trend-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kk-sparkline {
  width: 90px;
  height: 28px;
}

/* Olgusal Cümle */
.kk-fact-text {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
  margin: 0;
}

.kk-fact-diff-plus {
  color: #15803d;
  font-weight: 700;
}

.kk-fact-diff-minus {
  color: #b91c1c;
  font-weight: 700;
}

/* Kart Aksiyonları */
.kk-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  flex-wrap: wrap;
}

.kk-card-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
}

.kk-card-links a {
  color: #2563eb;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kk-btn-basket {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.kk-btn-basket.is-add {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
}

.kk-btn-basket.is-add:hover {
  background: #e2e8f0;
}

.kk-btn-basket.is-remove {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* ==========================================================================
   5. Taslak Tercih Listesi (Sepet)
   ========================================================================== */
.kk-basket-container {
  margin-top: 32px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(10, 25, 60, 0.05);
}

.kk-basket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.kk-basket-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kk-basket-badge {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

.kk-basket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.kk-basket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.825rem;
}

.kk-basket-item-info {
  flex: 1;
}

.kk-basket-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
}

.kk-basket-empty {
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
  padding: 16px;
}

.kk-basket-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   6. Yükleniyor, Boş Durum & Hata Durumu
   ========================================================================== */
.kk-skeleton-card {
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: kk-shimmer 1.5s infinite;
}

@keyframes kk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.kk-empty-state,
.kk-error-state {
  text-align: center;
  padding: 40px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: #475569;
}

.kk-empty-state i,
.kk-error-state i {
  font-size: 36px;
  color: #94a3b8;
  margin-bottom: 12px;
}

/* Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .kk-skeleton-card {
    animation: none;
    background: #f1f5f9;
  }
  .kk-card,
  .kk-btn-basket,
  .kk-duzey-card {
    transition: none;
  }
}
