@import '../src/styles/tokens.css';
/* ══════════════════════════════════════════════
   ARKA PLAN
══════════════════════════════════════════════ */
.bg-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
}
.bg-glow {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.09;
  animation: drift 14s ease-in-out infinite alternate;
}
.bg-glow--1 { width:500px; height:500px; top:-150px; left:-80px;  background: radial-gradient(circle,#c9a84c,transparent 70%); }
.bg-glow--2 { width:400px; height:400px; top:20%; right:-120px;   background: radial-gradient(circle,#60c8f0,transparent 70%); animation-delay:-6s; opacity:0.06; }
@keyframes drift {
  from { transform: translate(0,0)   scale(1);   }
  to   { transform: translate(30px,20px) scale(1.06); }
}

/* ══════════════════════════════════════════════
   PAGE WRAP
══════════════════════════════════════════════ */
.page-wrap {
  position: relative; z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ══════════════════════════════════════════════
   ÜST BAR
══════════════════════════════════════════════ */
.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.back-btn {
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.back-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.history-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.history-toggle-btn:hover,
.history-toggle-btn.active {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════
   ANA LAYOUT — 2 sütun
══════════════════════════════════════════════ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ══════════════════════════════════════════════
   ÇEVİRİ PANELİ (sol)
══════════════════════════════════════════════ */
.translate-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Dil seçici */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.lang-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.lang-btn.active {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.25);
  color: var(--gold);
}
.lang-btn:not(.active):hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.lang-swap-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.lang-swap-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: rotate(180deg);
}

/* Input wrap */
.input-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color var(--transition);
}
.input-wrap:focus-within {
  border-color: rgba(201,168,76,0.3);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.06);
}

.source-input {
  width: 100%;
  min-height: 120px;
  padding: 18px 20px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.source-input::placeholder { color: var(--text-muted); }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 12px;
  gap: 8px;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.translate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #0a0a0f;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.translate-btn:hover {
  background: #e2bc5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}
.translate-btn:active { transform: translateY(0); }
.translate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Sonuç kutusu */
.result-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  animation: fadeSlideIn 0.3s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-word-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(79,214,156,0.1);
  border: 1px solid rgba(79,214,156,0.25);
  border-radius: 7px;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.save-word-btn:hover {
  background: rgba(79,214,156,0.2);
  border-color: rgba(79,214,156,0.4);
  transform: translateY(-1px);
}
.save-word-btn.saved {
  background: rgba(79,214,156,0.15);
  border-color: rgba(79,214,156,0.4);
  color: var(--green);
  cursor: default;
  transform: none;
}

.result-main {
  padding: 20px;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* Alternatif çeviriler */
.alt-translations {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}
.alt-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.alt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alt-chip {
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
}
.alt-chip:hover {
  border-color: rgba(201,168,76,0.4);
  color: var(--gold);
  background: var(--gold-d);
}

/* Hata & Yükleniyor */
.error-wrap {
  padding: 14px 16px;
  background: rgba(240,112,104,0.08);
  border: 1px solid rgba(240,112,104,0.2);
  border-radius: var(--radius-sm);
  color: var(--rose);
  font-size: 13px;
}

.loading-wrap,
.detail-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-dots {
  display: flex; gap: 4px;
}
.loading-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ══════════════════════════════════════════════
   DETAY PANELİ (sağ)
══════════════════════════════════════════════ */
.detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
}
.detail-empty-icon { font-size: 32px; opacity: 0.4; }
.detail-empty p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.detail-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeSlideIn 0.3s ease both;
}

/* Kelime bilgisi kartı */
.word-info-card {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.word-info-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.word-artikel {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  letter-spacing: 0.02em;
}
.word-artikel:empty { display: none; }

.word-artikel.der { background: rgba(96,200,240,0.12); color: var(--blue); }
.word-artikel.die { background: rgba(240,112,104,0.12); color: var(--rose); }
.word-artikel.das { background: rgba(160,100,255,0.12); color: #a064ff; }

.word-display {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.word-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.word-meta span {
  display: inline-block;
  margin-right: 12px;
}

/* Örnek cümleler */
.examples-section { display: flex; flex-direction: column; gap: 10px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.example-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.example-item:hover {
  border-color: var(--border-hover);
}

.example-de {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 4px;
  font-family: var(--font-body);
}
.example-de strong {
  color: var(--gold);
  font-weight: 600;
}

.example-tr {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}

.example-source {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
  opacity: 0.6;
}

/* Wiktionary linki */
.wiktionary-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--transition);
}
.wiktionary-link:hover { color: var(--gold); }

/* ══════════════════════════════════════════════
   GEÇMİŞ PANELİ
══════════════════════════════════════════════ */
.history-panel {
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  animation: fadeSlideIn 0.2s ease both;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.history-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.clear-history-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.clear-history-btn:hover {
  border-color: rgba(240,112,104,0.4);
  color: var(--rose);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}

.history-empty {
  color: var(--text-muted);
  font-size: 12px;
  width: 100%;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  max-width: 200px;
}
.history-item:hover {
  border-color: rgba(201,168,76,0.3);
  background: var(--gold-d);
}

.history-item-src {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-arrow {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-item-tgt {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #0f0f14;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 28px;
  width: 420px;
  max-width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-field {
  margin-bottom: 16px;
}

.modal-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.modal-input::placeholder { color: var(--text-muted); }
.modal-input:focus {
  border-color: rgba(201,168,76,0.4);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.06);
}

.tag-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-status {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.modal-status.success {
  background: rgba(79,214,156,0.1);
  border: 1px solid rgba(79,214,156,0.25);
  color: var(--green);
}
.modal-status.error {
  background: rgba(240,112,104,0.1);
  border: 1px solid rgba(240,112,104,0.2);
  color: var(--rose);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-cancel-btn {
  flex: 1;
  padding: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-cancel-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-save-btn {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a0f;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.modal-save-btn:hover {
  background: #e2bc5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}
.modal-save-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-wrap { padding: 20px 16px 60px; }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .lang-btn span { display: none; }
  .lang-btn { padding: 8px; font-size: 18px; }

  .page-title { font-size: 18px; }

  .history-toggle-btn span { display: none; }

  .result-main { font-size: 18px; }
  .word-display { font-size: 16px; }
}

@media (max-width: 480px) {
  .top-bar { gap: 10px; }
  .back-btn { padding: 7px 10px; font-size: 12px; }
}
