/**
 * de-digger — extra UI styles for search UX improvements
 * Kept in a separate file on purpose: theme.css is a compiled/vendor
 * stylesheet, this one is hand-written and easy to touch/extend.
 */

/* Shared-width wrapper so the CSE search box, filter chips, recent
   searches card and share button all line up on the same edges. */
.ddg-search-wrap {
  max-width: 700px;
  margin: 0 auto;
}

.ddg-search-wrap .gcse-search,
.ddg-search-wrap .gsc-control-cse,
.ddg-search-wrap .gsc-search-box,
.ddg-search-wrap table.gsc-search-box {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

.ddg-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 6px;
}

.ddg-toolbar-secondary {
  margin-top: 4px;
}

.ddg-chip {
  background: #fff;
  border: 1px solid #CF4327;
  color: #CF4327;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.ddg-chip:hover {
  background: #fbe4dd;
}

.ddg-chip.active {
  background: #CF4327;
  color: #fff;
}

.ddg-share-chip {
  border-color: #574730;
  color: #574730;
}

.ddg-share-chip:hover {
  background: #ece7e0;
}

.ddg-recent-card {
  position: relative;
  margin: 4px 0 16px;
  border-radius: 10px;
  background: #f7f6f4;
  border: 1px solid #e2ddd4;
}

.ddg-recent-card .card-body {
  padding: 18px 20px 16px;
}

.ddg-card-title {
  font-weight: 700;
  color: #574730;
  margin-bottom: 12px;
  padding-right: 24px;
}

.ddg-toolbar-label {
  align-self: center;
  font-size: 0.85rem;
  color: #6c6c6c;
  margin-right: 2px;
}

.ddg-preview-link {
  position: relative;
  display: block;
}

.ddg-file-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.ddg-badge-pdf { background: #d64545; }
.ddg-badge-doc { background: #2f6fed; }
.ddg-badge-xls { background: #1f9d55; }
.ddg-badge-ppt { background: #e07b1f; }
.ddg-badge-zip { background: #6b5b95; }
.ddg-badge-video { background: #333; }
.ddg-badge-iso { background: #17a2b8; }

.ddg-recent-count {
  font-size: 0.72rem;
  color: #7a9a6b;
  margin-left: 6px;
  font-weight: 600;
}

.ddg-recent-count-empty {
  color: #b5533f;
}

/* Compact list view: same card markup, restyled into a slim row.
   The big preview/badge is hidden on purpose — that's the point of
   a compact view — everything else keeps working (favorite, open,
   download, metadata, share). */
body.ddg-view-list .ddg-result-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 !important;
  padding: 8px 14px;
  border-radius: 8px;
}

body.ddg-view-list .ddg-result-card .card-header,
body.ddg-view-list .ddg-result-card .card-footer {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.ddg-view-list .ddg-result-card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
}

body.ddg-view-list .ddg-result-card .card-header h5 {
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

body.ddg-view-list .ddg-result-card .favicon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

body.ddg-view-list .ddg-result-card .card-body {
  display: none;
}

body.ddg-view-list .ddg-result-card .card-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px;
}

body.ddg-view-list .ddg-result-card .card-footer .btn {
  padding: 3px 10px;
  font-size: 0.75rem;
}

.ddg-recent-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0.6;
}

.ddg-recent-close:hover {
  opacity: 1;
}

.ddg-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.ddg-recent-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  color: #333;
  font-size: 0.82rem;
  transition: background-color .15s ease, border-color .15s ease;
}

.ddg-recent-item:hover {
  background: #eee;
  border-color: #CF4327;
}

.ddg-clear-recent {
  border-color: #999;
  color: #666;
}

.ddg-clear-recent:hover {
  background: #eee;
  border-color: #CF4327;
  color: #CF4327;
}

@media (max-width: 480px) {
  .ddg-chip {
    font-size: 0.78rem;
    padding: 3px 10px;
  }
}

.ddg-fav-btn {
  cursor: pointer;
}

.ddg-fav-btn i {
  color: #574730;
}

.ddg-fav-btn.active i {
  color: #ff4d6d;
}

.ddg-favorites-empty {
  color: #6c6c6c;
  font-style: italic;
  margin: 30px 0;
}

.ddg-fav-note-wrap {
  padding: 10px 16px !important;
}

.ddg-fav-note {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #444;
  resize: vertical;
}

.ddg-fav-note:focus {
  outline: none;
  border-color: #CF4327;
}

.ddg-category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ddg-category-links .btn {
  margin-left: 0 !important;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  row-gap: 10px;
}

.card-footer > * {
  margin-left: 0 !important;
}

.ddg-fav-btn {
  padding-left: 14px;
  padding-right: 14px;
}
