/* ==========================================================================
   4. Postmark Screenshot Preview Popup (#screenshot)
   ========================================================================== */

#screenshot {
  position: fixed;
  border: 1px solid rgba(52, 104, 148, 0.32);
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 14px;
  display: none;
  color: #1e334a;
  z-index: 99999;
  pointer-events: auto;
  max-width: 380px;
  width: auto;
  box-shadow: 0 18px 44px rgba(30, 51, 74, 0.24);
  box-sizing: border-box;
}

.screenshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(30, 51, 74, 0.12);
}

.screenshot-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1e334a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screenshot-type-badge {
  font-size: 11px;
  font-weight: 700;
  color: #346894;
  background: #edf3f8;
  border: 1px solid rgba(52, 104, 148, 0.25);
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.screenshot-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #53697e;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  transition: color 0.15s ease;
}

.screenshot-close-btn:hover {
  color: #d9383a;
}

.screenshot-img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #ffffff 40%, #edf3f8 100%);
  border: 1px solid rgba(30, 51, 74, 0.12);
  border-radius: 8px;
  padding: 10px;
  min-height: 100px;
}

img.screenshot2 {
  max-width: 320px;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   Search Results Responsive Card View (Tablets & Mobile: max-width: 1024px)
   ========================================================================== */
@media screen and (max-width: 1024px) {
  .searchresult thead,
  .search-results-table thead,
  .searchresult tr.search-table-header {
    display: none !important;
  }

  .searchresult table,
  .searchresult thead,
  .searchresult tbody,
  .searchresult tr,
  .searchresult td,
  .search-results-table,
  .search-results-table tbody,
  .search-results-table tr,
  .search-results-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .searchresult table,
  .search-results-table {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .searchresult-table-wrap,
  .search-table-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .searchresult tbody tr,
  .search-results-table tbody tr {
    margin-bottom: 14px !important;
    border: 1px solid rgba(30, 51, 74, 0.16) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(30, 51, 74, 0.05) !important;
    overflow: hidden !important;
  }

  .searchresult tbody tr:first-child,
  .search-results-table tbody tr:first-child {
    display: block !important;
  }

  .searchresult td,
  .search-results-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: right !important;
    padding: 8px 12px !important;
    border: none !important;
    border-bottom: 1px solid rgba(30, 51, 74, 0.07) !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
    width: 100% !important;
    white-space: normal !important;
  }

  .searchresult td:last-child,
  .search-results-table td:last-child {
    border-bottom: none !important;
  }

  .searchresult td[data-empty="true"],
  .search-results-table td[data-empty="true"] {
    display: none !important;
  }

  .searchresult td::before,
  .search-results-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #53697e;
    text-align: left;
    margin-right: 12px;
    flex-shrink: 0;
  }

  .searchresult td.td-area,
  .search-results-table td.td-area,
  .searchresult td.td-comment,
  .search-results-table td.td-comment,
  .searchresult td.td-name,
  .search-results-table td.td-name,
  .searchresult td.td-base-name,
  .search-results-table td.td-base-name {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  .searchresult td.td-area::before,
  .search-results-table td.td-area::before,
  .searchresult td.td-comment::before,
  .search-results-table td.td-comment::before,
  .searchresult td.td-name::before,
  .search-results-table td.td-name::before,
  .searchresult td.td-base-name::before,
  .search-results-table td.td-base-name::before {
    margin-bottom: 4px;
  }

  .searchresult td.td-thumb,
  .search-results-table td.td-thumb {
    justify-content: space-between !important;
  }

  .searchresult td.td-thumb img,
  .search-results-table td.td-thumb img {
    width: 56px !important;
    height: 56px !important;
  }
}

