/* Cakmak Pro — Instant Document Search Styles */

.doc-search-container {
  position: relative;
  flex: 1 1 340px;
  max-width: 460px;
  min-width: 260px;
}

.doc-search-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.doc-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a6a2a;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-search-input {
  width: 100%;
  height: 44px;
  padding: 0 46px 0 42px;
  background: #ffffff;
  border: 1.5px solid rgba(120, 90, 40, 0.22);
  border-radius: 10px;
  font-family: var(--sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 13.5px;
  color: #1d1612;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.doc-search-input:focus {
  outline: none;
  border-color: #c9a25c;
  box-shadow: 0 0 0 4px rgba(201, 162, 92, 0.18);
}

.doc-search-input::placeholder {
  color: #9c9287;
  font-weight: 400;
}

.doc-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(120, 90, 40, 0.12);
  border: none;
  color: #5a4d3e;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.doc-search-clear:hover {
  background: #910000;
  color: #ffffff;
}

.doc-search-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(201, 162, 92, 0.25);
  border-top-color: #910000;
  border-radius: 50%;
  animation: ds-spin 0.6s linear infinite;
  display: none;
}

@keyframes ds-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Hotkey hint badge */
.doc-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #8a6a2a;
  background: #f4f0ea;
  border: 1px solid rgba(120, 90, 40, 0.18);
  border-radius: 4px;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Floating Results Dropdown */
.doc-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(120, 90, 40, 0.22);
  border-radius: 14px;
  box-shadow: 0 20px 50px -12px rgba(25, 20, 15, 0.26);
  max-height: 460px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
}

.doc-search-dropdown.is-open {
  display: block;
  animation: ds-fade-down 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ds-fade-down {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ds-dropdown-header {
  padding: 10px 16px;
  background: #faf8f5;
  border-bottom: 1px solid rgba(120, 90, 40, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #7a6850;
}

.ds-total-count {
  font-weight: 700;
  color: #910000;
}

.ds-kbd-hint {
  font-size: 10.5px;
  color: #9c9287;
  letter-spacing: 0.04em;
}

.ds-result-list {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}

.ds-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(120, 90, 40, 0.07);
  transition: background 0.15s ease;
  cursor: pointer;
}

.ds-item:last-child {
  border-bottom: none;
}

.ds-item:hover,
.ds-item.is-active {
  background: rgba(201, 162, 92, 0.09);
}

.ds-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ds-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.ds-badge-dilekce {
  background: rgba(145, 0, 0, 0.08);
  color: #910000;
}

.ds-badge-sozlesme {
  background: rgba(201, 162, 92, 0.15);
  color: #785a28;
}

.ds-cat-label {
  font-size: 11px;
  color: #8a6a2a;
  font-weight: 600;
}

.ds-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.35;
  color: #1d1612;
  font-weight: 600;
}

.ds-excerpt {
  font-size: 12.5px;
  line-height: 1.5;
  color: #5a4d3e;
}

.ds-item mark {
  background: rgba(201, 162, 92, 0.28);
  color: #910000;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

.ds-arrow {
  color: #c9a25c;
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.ds-item:hover .ds-arrow,
.ds-item.is-active .ds-arrow {
  transform: translateX(3px);
  color: #910000;
}

/* Cross-Discovery Notice */
.ds-cross-discovery {
  margin: 8px 12px 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(145, 0, 0, 0.05) 0%, rgba(201, 162, 92, 0.12) 100%);
  border: 1px solid rgba(201, 162, 92, 0.35);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #4a3f33;
}

.ds-cross-discovery a {
  color: #910000;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ds-cross-discovery a:hover {
  text-decoration: underline;
}

/* Empty State */
.ds-empty {
  padding: 28px 20px;
  text-align: center;
}

.ds-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.ds-empty-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  color: #1d1612;
  margin: 0 0 6px;
}

.ds-empty-desc {
  font-size: 12.5px;
  color: #7a6850;
  line-height: 1.5;
  margin: 0 0 12px;
}

.ds-empty-cta {
  font-size: 12px;
  font-weight: 600;
  color: #910000;
  text-decoration: none;
}

.ds-empty-cta:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .doc-search-container {
    max-width: 100%;
    order: -1;
    margin-bottom: 8px;
  }
  .ds-kbd-hint {
    display: none;
  }
}
