/* Heritage Newspaper Search - Türkiye Gazetesi Arşiv */
:root {
  --primary: #d41121;
  --primary-dark: #b00e1b;
  --parchment: #FDFBF7;
  --card: #fff;
  --text: #2c2a26;
  --muted: #6b6560;
  --border: #e5e0d8;
  --mark: rgba(212, 17, 33, 0.18);
  --max-width: 480px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Work Sans', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
}

.bg-parchment {
  background-color: var(--parchment);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%23d41121' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
  position: relative;
}

.main {
  flex: 1;
  padding: 0 1.25rem 1.5rem;
}

.main:has(.share-page-wrapper) {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main:has(.newspaper-page) {
  padding: 0;
}

.share-page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.share-page-body.pdf-modal-body {
  flex: 1;
  position: relative;
  overflow: auto;
  min-height: 0;
}

.share-page-body .pdf-modal-paper-wrap {
  position: absolute;
  inset: 0;
}

.share-page-body .share-zoom-container {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.share-page-body .share-zoom-container .zoom-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-page-body .share-img-wrap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.share-page-appbar {
  position: relative;
  justify-content: center;
}

.share-page-appbar .pdf-modal-date {
  flex: 1;
}

.share-page-appbar .pdf-modal-icon-btn {
  position: absolute;
  right: 1rem;
}

.share-img-wrap {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-page-body .no-img {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Page Header Brand - Liste sayfası */
.page-header-brand {
  padding: 2rem;
  text-align: center;
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.25rem 0 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 2px solid rgba(212, 17, 33, 0.2);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.brand-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0.5rem 0 0;
}

/* Header - Detay sayfası için */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

.header-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-back-btn {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.header-back-btn:hover {
  color: var(--primary);
}

.header-share-btn {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-share-btn:hover {
  color: var(--primary);
}

.header-share-btn .material-icons-round {
  font-size: 1.35rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-icon {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* Search Form - Yeni tasarım */
.search-form-new {
  margin-bottom: 1.5rem;
  
  min-width: 0;
}

.search-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.25rem;
  line-height: 1.4;
}

/* SweetAlert2 mobil uyumluluk */
.swal2-popup.swal-mobile {
  max-width: 90vw;
  padding: 1.25rem;
}

.ai-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.ai-mode-btn-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ai-mode-beta {
  position: absolute;
  top: -0.4rem;
  right: -0.25rem;
  z-index: 2;
  background: #C5A059;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: rotate(3deg);
}

.ai-toggle {
  display: flex;
  background: var(--card);
  padding: 0.25rem;
  border-radius: 9999px;
  padding: 0.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ai-toggle-item {
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.ai-toggle-item:hover {
  color: var(--text);
}

.ai-toggle-active {
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
}

.ai-toggle-active:hover {
  background: var(--primary-dark);
  color: #fff !important;
}

/* AI Modu seçiliyken mavimsi gradient */
#aiModeBtn.ai-toggle-active {
  background: linear-gradient(to right, #2563eb, #4f46e5) !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
}

#aiModeBtn.ai-toggle-active:hover {
  background: linear-gradient(to right, #1d4ed8, #4338ca) !important;
}

.ai-suggest-switch-btn {
  margin-top: 1rem;
  background: linear-gradient(to right, #2563eb, #4f46e5);
  color: #fff !important;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ai-suggest-switch-btn:hover {
  background: linear-gradient(to right, #1d4ed8, #4338ca);
  transform: translateY(-1px);
}

/* Pulsating burgundy glow animation */
@keyframes pulse-burgundy {
  0%, 100% { box-shadow: 0 0 15px 2px rgba(212, 17, 33, 0.4); }
  50% { box-shadow: 0 0 25px 6px rgba(212, 17, 33, 0.6); }
}

@keyframes custom-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-input-wrap-new {
  margin-bottom: 0.5rem;
  position: relative;
}

.search-input-glow {
  position: absolute;
  inset: -8px;
  border-radius: 2rem;
  background: rgba(212, 17, 33, 0.2);
  filter: blur(8px);
  animation: pulse-burgundy 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}

.search-input-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 1.75rem;
  border: 1px solid rgba(229, 224, 216, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.search-input-top {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1rem 0.5rem;
}

.search-icon-new {
  color: var(--primary);
  font-size: 1.5rem;
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.search-input-new {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 0.375rem 0;
  outline: none;
  resize: none;
  overflow: hidden;
  font-weight: 500;
  line-height: 1.5;
}

.search-input-new::placeholder {
  color: rgba(107, 101, 96, 0.45);
}

.search-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-badge.ai-only {
  color: #2563eb;
}

.search-badge.ai-only .material-icons-round {
  font-size: 14px;
}

.search-badge.classic-only {
  color: var(--muted);
  font-weight: 500;
}

.search-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-clear-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

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

.search-clear-btn .material-icons-round {
  font-size: 1.25rem;
}

.search-submit-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.search-submit-btn:hover {
  background: var(--primary-dark);
}

.search-submit-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.search-submit-btn .material-icons-round {
  font-size: 1.125rem;
}

.match-type-wrap {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem;
}

.match-type-label {
  cursor: pointer;
  margin: 0;
}

.match-type-btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid rgba(212, 17, 33, 0.2);
  background: rgba(212, 17, 33, 0.05);
  color: var(--primary);
  transition: all 0.2s;
}

.match-type-label input:checked + .match-type-btn,
.match-type-active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 700;
}

.match-type-label input:not(:checked) + .match-type-btn:not(.match-type-active) {
  background: var(--card);
  color: var(--muted);
  border-color: var(--border);
}

.decade-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.decade-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.decade-scroll::-webkit-scrollbar {
  display: none;
}

.decade-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.decade-btn:hover {
  border-color: rgba(212, 17, 33, 0.5);
}

.decade-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}

.topics-wrap {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.topics-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 10px;
}

.topic-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.topic-btn:hover {
  border-color: rgba(37, 99, 235, 0.5);
  color: #2563eb;
}

/* Güne Git */
.go-date-wrap {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.go-date-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.35rem;
}

.go-date-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.go-date-field {
  margin-bottom: 1rem;
}

.go-date-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.go-date-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  cursor: pointer;
  color: var(--text);
}

.go-date-read-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.go-date-read-btn:hover:not(:disabled) {
  background: var(--primary-dark, #a00);
}

.go-date-read-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.go-date-error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Newspaper detail page */
.newspaper-page {
  padding: 1rem 0;
  max-width: 100%;
}

.newspaper-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.newspaper-date-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.newspaper-date-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.75rem;
}

.newspaper-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--card);
  border-radius: 9999px;
  border: 1px solid var(--border);
}

.newspaper-toolbar .zoom-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  transition: all 0.2s;
}

.newspaper-toolbar .zoom-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

.newspaper-toolbar .zoom-level {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  min-width: 3rem;
  text-align: center;
}

.newspaper-viewer {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  min-height: 60vh;
  position: relative;
}

.newspaper-side-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border: none;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  z-index: 2;
}

.newspaper-side-nav.newspaper-prev {
  left: 0.5rem;
}

.newspaper-side-nav.newspaper-next {
  right: 0.5rem;
}

.newspaper-side-nav .material-icons-round {
  font-size: 32px;
}

.newspaper-side-nav:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 17, 33, 0.3);
}

.newspaper-side-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.newspaper-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.newspaper-body .newspaper-img-wrap {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.newspaper-body .zoom-container {
  flex: 1;
  width: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.newspaper-img-wrap {
  position: relative;
  background: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.newspaper-page-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(253, 251, 247, 0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.newspaper-page-loading.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.newspaper-page-loading-spinner {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  border: 3px solid rgba(212, 17, 33, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: custom-spin 0.8s linear infinite;
}

.newspaper-page-loading-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.newspaper-modal-img-wrap {
  position: relative;
}

.newspaper-img-clickable {
  cursor: pointer;
}

.newspaper-img-clickable:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.newspaper-body .img-box-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.newspaper-page-info {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
  padding: 0.5rem 0;
}

@media (max-width: 600px) {
  .newspaper-viewer {
    gap: 0.35rem;
  }
  .newspaper-side-nav {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
  .newspaper-side-nav.newspaper-prev {
    left: 0.25rem;
  }
  .newspaper-side-nav.newspaper-next {
    right: 0.25rem;
  }
  .newspaper-side-nav .material-icons-round {
    font-size: 28px;
  }
}

.ai-result-card {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ai-message-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

.ai-message-content p {
  margin: 0 0 1rem;
}

.ai-message-content p:last-child {
  margin-bottom: 0;
}

.ai-message-content strong {
  font-weight: 700;
  color: var(--primary);
}

.ai-result-interleaved {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ai-message-block {
  margin-bottom: 0;
}

.ai-source-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-source-block .ai-source-item {
  display: block;
  padding: 0;
}

.ai-source-block .ai-source-item img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 0.5rem;
}

.ai-source-caption {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ai-message-content içinde paragraf sonrası inline görsel */
.ai-source-inline-wrap {
  margin: 1rem 0;
}

.ai-seed-notice {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}

.ai-source-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.ai-source-inline {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-source-inline:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(212, 17, 33, 0.15);
}

.ai-source-seed-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.ai-source-seed-block .ai-source-inline {
  display: block;
}

.ai-source-seed-title,
.ai-source-seed-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  width: 100%;
  text-align: left;
}

.ai-source-seed-text {
  margin: 0 0 0.5rem;
}

.ai-source-inline img {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.ai-source-inline .ai-source-date {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 0.5rem 0.5rem;
}

.ai-sources-list {
  margin-bottom: 1.25rem;
}

.ai-sources-title,
.ai-message-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

/* AI Stats view (isStats: true) */
.ai-stats-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ai-stats-h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.5rem;
}

.ai-stats-h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.5rem;
}

.ai-stats-summary {
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.75rem 1rem;
  background: rgba(212, 17, 33, 0.06);
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary);
}

.ai-stats-total {
  font-weight: 600;
}

.ai-stats-term {
  color: var(--primary);
  font-weight: 600;
}

.ai-stats-section {
  margin-top: 1rem;
}

.ai-stats-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.ai-stats-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.ai-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ai-stats-table th,
.ai-stats-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ai-stats-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.ai-stats-table tr:last-child td {
  border-bottom: none;
}

.ai-stats-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.ai-stats-list li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.ai-stats-samples {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-stats-sample {
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.ai-stats-sample-date {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.35rem;
}

.ai-stats-sample-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.ai-stats-sources-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ai-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.ai-source-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-source-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.ai-source-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.ai-source-date {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 0.25rem 0.35rem;
}

.source-image-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.source-image-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.source-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.source-image-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-image-modal-content img {
  max-width: 100%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.source-image-modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.source-image-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.date-range-wrap {
  margin-bottom: 0;
  overflow-x: hidden;
  min-width: 0;
}

.date-field-inline {
  margin-bottom: 0;
}

.date-field-inline label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.date-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  overflow-x: hidden;
  min-width: 0;
}

.date-field-single {
  min-width: 0;
}

.date-field-single label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.date-field-single input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  cursor: pointer;
  color: var(--text);
  box-sizing: border-box;
}

.date-field-single input:hover {
  border-color: rgba(212, 17, 33, 0.3);
}

.date-field-single input::placeholder {
  color: var(--muted);
}

/* Flatpickr tema uyumu */
.flatpickr-calendar {
  font-family: 'Work Sans', sans-serif !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.flatpickr-day.inRange {
  background: rgba(212, 17, 33, 0.1) !important;
}

.date-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.date-field input {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Statistics Band */
.stats-band {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid rgba(212, 17, 33, 0.1);
  border-bottom: 1px solid rgba(212, 17, 33, 0.1);
  background: rgba(212, 17, 33, 0.05);
  border-radius: 0.5rem;
}

.stats-item {
  text-align: center;
}

.stats-num {
  display: block;
  font-family: Roboto;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.stats-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stats-divider {
  width: 1px;
  height: 2rem;
  background: rgba(212, 17, 33, 0.2);
}

/* Results Top - Page size + title */
.results-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.results-top-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.results-title-new {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.results-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.page-size-wrap-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-size-wrap-new label {
  font-size: 0.8rem;
  color: var(--muted);
}

.page-size-wrap-new select {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--text);
}

/* Results area & loading overlay */
.results-area {
  position: relative;
  scroll-margin-top: 1rem;
}

.results-wrapper {
  min-height: 0;
}

.search-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(253, 251, 247, 0.98);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.search-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.results-area.loading {
  min-height: 280px;
}

.results-area.loading .empty-state {
  visibility: hidden;
}

.search-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-loading-spinner {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(197, 160, 89, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: custom-spin 1.2s linear infinite;
}

.search-loading-t {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #C5A059;
}

.search-loading-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.125rem;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.search-loading-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.search-loading-label span:first-child {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.search-loading-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounce-dot 0.6s ease-in-out infinite alternate;
}

.search-loading-dots span:nth-child(1) { animation-delay: 0s; }
.search-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.search-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.search-loading-ai-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

@keyframes bounce-dot {
  from { transform: translateY(0); opacity: 0.5; }
  to { transform: translateY(-4px); opacity: 1; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 0.5rem;
}

/* Results */
.results-section {
  margin-top: 0;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.results-title {
  font-size: 1.25rem;
  margin: 0;
}

.results-badge {
  font-size: 0.85rem;
  color: var(--muted);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.alert-icon {
  font-size: 1.2rem;
}

/* News cards - Yeni tasarım */
.news-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-card {
  background: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: transform 0.15s;
}

.news-card:active {
  transform: scale(0.995);
}

.news-card-inner {
  display: flex;
  padding: 1rem;
  gap: 1rem;
}

.card-thumb {
  width: 96px;
  height: 128px;
  flex-shrink: 0;
  border-radius: 0.25rem;
  overflow: hidden;
  background: var(--border);
  position: relative;
  border: 1px solid var(--border);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.3);
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
}

.card-thumb-placeholder .material-icons-round {
  font-size: 2rem;
  color: var(--muted);
}


.card-body-new {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.card-date-new {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-issue {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: var(--border);
  color: var(--muted);
  border-radius: 9999px;
}

.card-summary-new {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp:5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary-new mark {
  background: var(--mark);
  padding: 0 0.15em;
  border-radius: 2px;
  font-weight: 600;
  color: var(--primary);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-btn {
  padding: 0.5rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
}

.pagination-btn:hover:not(.disabled) {
  background: var(--primary);
  color: #fff;
}

.pagination-btn.disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--muted);
}

.empty-results {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Detail page */
.page-detail {
  max-width: var(--max-width);
  margin: 0 auto;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.back-link {
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-date-centered {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.detail-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.detail-card {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.card-heading {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.detail-meta dt {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.detail-meta dt:first-child {
  margin-top: 0;
}

.detail-meta dd {
  margin: 0.25rem 0 0;
}

.detail-meta code {
  font-size: 0.85rem;
  background: var(--parchment);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.img-box-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.newspaper-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.boxes-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.boxes-overlay rect {
  pointer-events: auto;
}

.zoom-container {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--parchment);
}

.zoom-wrapper {
  transform-origin: 0 0;
  display: inline-block;
  min-width: min-content;
}

.zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.zoom-btn {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.zoom-btn .material-icons-round {
  font-size: 1.2rem;
}

.zoom-level {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 3rem;
  text-align: center;
}

.article-text {
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.article-text mark,
.text-modal-body mark {
  background: var(--mark);
  padding: 0 0.15em;
  border-radius: 2px;
  color: var(--primary);
  font-weight: 600;
}

.not-found {
  padding: 2rem;
  text-align: center;
}

.not-found-hint {
  margin: 1.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.not-found-results {
  text-align: left;
  margin-top: 1rem;
}

/* PDF Preview */
.pdf-preview {
  cursor: pointer;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--parchment);
}

.preview-img {
  display: block;
  width: 100%;
  height: auto;
}

.preview-hint {
  display: block;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--parchment);
}

/* PDF Modal - glassmorphism + paper style */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.pdf-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.pdf-modal-paper-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.pdf-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-modal-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pdf-modal-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(248, 246, 246, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 17, 33, 0.05);
}

.pdf-modal-toolbar {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  gap: 0.5rem;
  background: rgba(248, 246, 246, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 17, 33, 0.05);
  flex-wrap: wrap;
  justify-content: center;
}

.pdf-modal-close {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}

.pdf-modal-close:hover {
  transform: translateX(-2px);
}

.pdf-modal-close .material-icons-round {
  font-size: 1.5rem;
}

.pdf-modal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdf-modal-date-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pdf-modal-date-label {
  font-size: 10px;
  color: rgba(212, 17, 33, 0.8);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.15rem;
}

.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pdf-modal-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, background 0.2s;
}

.pdf-modal-icon-btn:hover {
  color: var(--primary);
  background: rgba(212, 17, 33, 0.05);
}

.pdf-modal-icon-btn .material-icons-round {
  font-size: 1.25rem;
}

.zoom-btn.pdf-modal-icon-btn {
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  font-weight: 600;
  border: none;
  background: none;
}

.zoom-level {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 2.5rem;
  text-align: center;
}

.pdf-modal-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 100%;
  min-width: 0;
}

.pdf-modal-search-input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  min-width: 80px;
}

.pdf-modal-search-input::placeholder {
  color: var(--muted);
}

.pdf-modal-search-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pdf-modal-search-btn:hover {
  background: var(--primary-dark);
}

.pdf-modal-body {
  flex: 1;
  position: relative;
  overflow: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.pdf-modal-paper-wrap {
  position: absolute;
  inset: 0;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  background: #fbfbf0;
  border: none;
}

.pdf-modal-paper-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  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.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.pdf-modal-body .zoom-container {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.pdf-modal-body .zoom-wrapper {
  transform-origin: 0 0;
  display: inline-block;
  min-width: min-content;
}

.pdf-modal-body .img-box-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-modal-body .newspaper-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  filter: sepia(0.12) contrast(1.03);
}

.pdf-modal-body .boxes-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Newspaper modal: sayfa değiştirme okları zoom alanında */
.newspaper-modal-body {
  position: relative;
}

.newspaper-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.newspaper-modal-nav:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 17, 33, 0.3);
}

.newspaper-modal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.newspaper-modal-nav .material-icons-round {
  font-size: 32px;
}

.newspaper-modal-prev {
  left: 0.5rem;
}

.newspaper-modal-next {
  right: 0.5rem;
}

.pdf-modal-paper-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: linear-gradient(to top, rgba(251, 251, 240, 0.4), transparent);
  pointer-events: none;
}

.zoom-download {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Text Content Modal */
.text-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  padding-top: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.text-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.text-modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.text-modal-content {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.text-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--parchment);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.text-modal-header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.text-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-modal-copy {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}

.text-modal-copy:hover {
  color: var(--primary);
}

.text-modal-copy .material-icons-round {
  font-size: 1.2rem;
}

.text-modal-close {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.text-modal-body {
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  -webkit-user-select: text;
}

/* .text-modal-body mark is now merged into .article-text mark above */

/* Back to top - sabit alt, yukarı ok */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 0px;
  transform: translateX(-50%);
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(212, 17, 33, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateX(-50%) translateY(-2px);
}

.back-to-top .material-icons-round {
  font-size: 1.75rem;
}

/* ========== Masaüstü Uyumluluk (min-width: 900px) ========== */
@media (min-width: 900px) {
  .app-shell {
    max-width: 80%;
  }

  .page-list-desktop-wrap {
    display: grid;
    grid-template-columns: minmax(320px, 1.3fr) minmax(360px, 1fr);
    gap: 1.5rem;
    align-items: start;
  }

  .page-list.page-list-inner {
    position: sticky;
    top: 1rem;
  }

  .page-list-results-col {
    min-width: 0;
  }
}

/* Zoom modal - masaüstünde max-height ile scroll olmadan tam görünüm */
@media (min-width: 900px) {
  .source-image-modal-content {
    max-height: 90vh;
  }

  .source-image-modal-content img {
    max-height: 90vh;
  }

  .pdf-modal-content {
    max-height: 100vh;
  }

  .pdf-modal-body {
    max-height: calc(100vh - 140px);
    overflow: auto;
  }
  .page-detail {
    min-width: 100%;
  }
  .detail-image {
    max-width: 50%;
  }
  .detail-card:not(.detail-image) {
    width: 100%;
  }
}

/* ========== Admin Panel ========== */
.admin-login-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.admin-login-title {
  font-size: 1.5rem;
  color: var(--primary);
  text-align: center;
  margin: 0 0 1.5rem;
}
.admin-login-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.admin-login-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-sizing: border-box;
}
.admin-login-form button {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-login-form button:hover {
  background: var(--primary-dark);
}
.admin-login-error {
  margin-top: 1rem;
  padding: 0.5rem;
  font-size: 0.9rem;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 0.5rem;
}
.admin-dashboard {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.admin-header h1 {
  font-size: 1.5rem;
  margin: 0;
}
.admin-logout-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
}
.admin-logout-btn:hover {
  background: var(--primary);
  color: #fff;
}
.admin-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.admin-nav-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 0.5rem;
}
.admin-nav-link:hover,
.admin-nav-link.active {
  background: rgba(212, 17, 33, 0.1);
  color: var(--primary);
}
.admin-section h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}
.admin-logs-table,
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.admin-logs-table th,
.admin-logs-table td,
.admin-users-table th,
.admin-users-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-logs-table th,
.admin-users-table th {
  background: rgba(0,0,0,0.03);
  font-weight: 600;
}
.admin-logs-table code {
  font-size: 0.75rem;
  word-break: break-all;
}
.admin-add-user-btn {
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}
.admin-edit-btn,
.admin-delete-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  margin-right: 0.25rem;
}
.admin-edit-btn {
  background: var(--primary);
  color: #fff;
  border: none;
}
.admin-delete-btn {
  background: #dc2626;
  color: #fff;
  border: none;
}
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.admin-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.admin-modal-content {
  position: relative;
  background: var(--card);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.admin-modal-content h3 {
  margin: 0 0 1rem;
}
.admin-modal-content label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.admin-modal-content input[type="text"],
.admin-modal-content input[type="password"],
.admin-modal-content input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-sizing: border-box;
}
.admin-hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}
.admin-checkboxes {
  margin-bottom: 1rem;
}
.admin-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.admin-modal-actions {
  display: flex;
  gap: 0.5rem;
}
.admin-modal-actions button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}
.admin-modal-actions button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
}
.admin-modal-actions button[type="button"] {
  background: var(--border);
  border: none;
}
.admin-logs-wrap {
  overflow-x: auto;
}
