/* ═══════════════════════════════════════════
   Altay Sözlük — Design System
   ═══════════════════════════════════════════ */

:root {
  --bg-primary: #06060c;
  --bg-secondary: #0c0c16;
  --bg-card: #12121f;
  --accent-red: #ef4444;
  --accent-crimson: #dc2626;
  --text-primary: #eaeaf2;
  --text-secondary: #a0a0b8;
  --text-muted: #5c5c72;
  --border-color: rgba(255, 255, 255, 0.08);
  --glow-red: 0 0 30px rgba(239, 68, 68, 0.15);
  --radius-md: 12px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Backgrounds */
.noise-overlay {
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Search */
.site-header {
  position: relative;
  z-index: 500;
  background: rgba(6, 6, 12, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
}

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

.brand {
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.brand .main { color: #fff; }
.brand .sub { color: var(--accent-red); margin-left: 2px; }

.search-wrapper {
  flex: 1;
  max-width: 500px;
  position: relative;
}

#searchInput {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 12px 20px 12px 45px;
  border-radius: 100px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent-red);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--accent-red);
}

/* Alphabet Filter */
.alphabet-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0;
  justify-content: center;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: #fff;
}

.filter-btn.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
  box-shadow: var(--glow-red);
}

.filter-btn[data-letter="all"] {
  width: auto;
  padding: 0 15px;
}

/* Dictionary Grid */
.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  padding-bottom: 80px;
}

.term-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.term-card:hover {
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-5px);
  background: #16162a;
}

.term-card.highlight-card {
  border-color: var(--accent-red);
  box-shadow: var(--glow-red);
  background: #1a1a2e;
  animation: pulse-highlight 2s infinite ease-in-out;
}

@keyframes pulse-highlight {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.anchor-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
  opacity: 0;
}

.term-card:hover .anchor-link {
  opacity: 1;
}

.anchor-link:hover {
  color: var(--accent-red);
}

.term-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.term-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.term-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.term-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 40px 0 80px;
}

.page-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.page-btn.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* No Result */
.no-result {
  text-align: center;
  padding: 80px 0;
}

.no-result.hidden { display: none; }

.empty-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.suggest-link {
  display: inline-block;
  margin-top: 15px;
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  background: var(--bg-secondary);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 15px; }
  .search-wrapper { max-width: 100%; }
  .alphabet-filter { gap: 5px; }
  .filter-btn { width: 32px; height: 32px; font-size: 0.75rem; }
  .dictionary-grid { grid-template-columns: 1fr; }
}
