/* Ortak (agy) | Made with agy */
:root {
  --bg-main: #08090d;
  --bg-card: #10121a;
  --bg-card-hover: #161924;
  --bg-input: #12141e;
  --border: #1e2230;
  --border-focus: #38bdf8;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-amber: #fbbf24;
  --accent-emerald: #34d399;
  --accent-violet: #a78bfa;
  --accent-rose: #f43f5e;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

.glow-bg {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(16, 18, 26, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Giriş Sayfası */
.giris-body {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.esik {
  width: 100%;
  max-width: 440px;
  background: rgba(16, 18, 26, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

.esik__ust {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.badge-dim {
  background: #151824;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #1f2438;
}

.marka-kutu {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.marka-logo {
  font-size: 24px;
  background: #182030;
  border: 1px solid #22324e;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marka {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.marka__nokta {
  color: var(--accent-cyan);
}

.slogan {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.kapi {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kapi__etiket {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.kapi__alan {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.kapi__alan:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.kapi__giris {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.kapi__gonder {
  background: #1e293b;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--accent-cyan);
  padding: 0 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.kapi__gonder:hover:not(:disabled) {
  background: #283548;
  color: #fff;
}

.kapi__gonder:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kapi__durum {
  font-size: 12px;
  min-height: 20px;
  padding-top: 4px;
}

.kapi__durum.hata {
  color: var(--accent-rose);
}

.kapi__durum.basari {
  color: var(--accent-emerald);
}

.esik__alt {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Topbar */
.topbar {
  background: rgba(13, 15, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 20px;
  background: #182030;
  border: 1px solid #22324e;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #101420;
  border: 1px solid #1f273c;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: #161a28;
  color: var(--text-main);
  border-color: #2b334a;
}

.btn-primary {
  background: #0284c7;
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #0369a1;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
  flex: 1;
  width: 100%;
}

/* Search Panel */
.search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  background: #141724;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #1a1e30;
  color: var(--text-main);
}

.tab-btn.active {
  background: #1e263c;
  color: var(--accent-cyan);
  border-color: #38bdf855;
}

.tab-count {
  font-size: 10px;
  background: #0a0c13;
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid #282f44;
  border-radius: 10px;
  padding: 0 16px;
  position: relative;
  transition: all 0.2s;
}

.search-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.search-icon {
  font-size: 16px;
  margin-right: 10px;
  color: var(--text-dim);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 15px;
  padding: 14px 0;
  outline: none;
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.btn-clear:hover {
  color: var(--text-main);
}

.search-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #1a1e2d;
  padding-top: 14px;
}

.pills-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill-label {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.pill-btn {
  background: #141724;
  border: 1px solid #1f2538;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.pill-btn:hover {
  background: #1e243a;
  color: var(--text-main);
  border-color: #2e3956;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.limit-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.limit-control select {
  background: #141724;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}

/* Results */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.results-time {
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-left: 6px;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  background: rgba(16, 18, 26, 0.4);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #1a2233;
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

/* Cards */
.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-2px);
  border-color: #2a344a;
  background: var(--bg-card-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.badge-site {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.badge-site.intel {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-site.esnaf {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-site.cevher {
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-site.girisim {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent-violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.score-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: #090a0f;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #181d2c;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.card-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

.rule-box {
  background: #090b10;
  border: 1px solid #1a2233;
  border-left: 3px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #bae6fd;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #181c2a;
  padding-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

.btn-detail {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}

.btn-detail:hover {
  text-decoration: underline;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-card {
  background: #10131d;
  border: 1px solid #252e44;
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #1e2538;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #1e2538;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border);
  background: rgba(10, 11, 16, 0.9);
  padding: 16px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
  .search-box {
    flex-direction: column;
  }
  .topbar-inner {
    padding: 10px 16px;
  }
  .container {
    padding: 16px;
  }
}
