/* rd-frontend.css - improved table and modal styling with person column */

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  color: #222;
}

/* Controls */
.rd-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
  flex-wrap: wrap;
}
.rd-controls input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  min-width: 260px;
}
.rd-controls select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cfcfcf;
}
.rd-controls button {
  padding: 8px 12px;
  border-radius: 6px;
  background: #1976d2;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Table */
.rd-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.rd-table thead {
  background: linear-gradient(180deg, #f6f7fb, #eef2f8);
}
.rd-table th,
.rd-table td {
  padding: 18px 14px;
  border-bottom: 1px solid #efefef;
  vertical-align: middle;
  text-align: left;
}
.rd-table th {
  font-weight: 700;
  color: #111;
  font-size: 16px;
  letter-spacing: 0.2px;
}
.rd-table tbody tr:nth-child(odd) {
  background: #fff;
}
.rd-table tbody tr:nth-child(even) {
  background: #fbfbfd;
}
.rd-table tbody tr:hover {
  background: #f3f7ff;
}

.rd-table td {
  font-size: 15px;
  color: #222;
}

/* Person column: photo + meta */
.rd-col-person {
  width: 320px;
}
.rd-person-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}
.rd-photo img,
.rd-photo div {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.rd-person-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-name {
  font-weight: 700;
  font-size: 15px;
  color: #111;
}
.rd-qual,
.rd-aff {
  font-size: 13px;
  color: #666;
}

/* Publication link style */
.rd-pub-link {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  background: #eef6ff;
  border: 1px solid #cfe6ff;
  color: #0b63a8;
  text-decoration: none;
}

/* Download button */
.rd-download-btn {
  background: #0b79d0;
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(11, 121, 208, 0.12);
}
.rd-download-btn:active {
  transform: translateY(1px);
}

/* Responsive */
@media (max-width: 980px) {
  .rd-table thead {
    display: none;
  }
  .rd-table,
  .rd-table tbody,
  .rd-table tr,
  .rd-table td {
    display: block;
    width: 100%;
  }
  .rd-table tr {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
  }
  .rd-table td {
    padding: 12px;
    border: 0;
    position: relative;
  }
  .rd-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: #666;
    margin-bottom: 6px;
  }
  .rd-controls {
    gap: 8px;
  }
  .rd-col-person {
    width: 100%;
  }
  .rd-person-wrap {
    align-items: flex-start;
  }
  .rd-photo img,
  .rd-photo div {
    width: 72px;
    height: 72px;
  }
}

/* footer total */
#rd_pagination {
  margin-top: 12px;
  font-weight: 600;
  color: #222;
}

/* Modal overlay & dialog */
#rd_request_modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 18, 28, 0.55);
  z-index: 99999;
  padding: 20px;
  display: flex; /* <-- ensure flex container */
}

#rd_request_modal .rd-dialog {
  width: 420px;
  max-width: 100%;
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(13, 25, 50, 0.35);
  position: relative;
  margin: auto; /* <-- ensures vertical centering */
}

/* close button */
#rd_close_modal {
  position: absolute;
  right: 12px;
  top: 10px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* modal form */
#rd_request_form input[type="text"],
#rd_request_form input[type="email"],
#rd_request_form input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-sizing: border-box;
  margin-bottom: 10px;
  font-size: 14px;
}

#rd_request_form label {
  font-size: 14px;
  color: #333;
}
#rd_request_form button[type="submit"] {
  background: #1976d2;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* message */
#rd_request_msg {
  margin-top: 10px;
  color: #111;
}

/* small screens modal tweaks */
@media (max-width: 520px) {
  #rd_request_modal .rd-dialog {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
  }
}

/* Card layout for researchers */
/* Cards container */
.rd-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

/* Single card */
.rd-card {
  display: flex;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}
.rd-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Thumbnail */
.rd-thumb-wrap {
  flex: 0 0 90px;
  margin-right: 14px;
}
.rd-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: #f2f4f6;
}

/* Info */
.rd-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0c2340;
}
.rd-qual {
  font-size: 14px;
  color: #444;
}
.rd-aff {
  font-size: 13px;
  color: #666;
}
.rd-topic {
  font-size: 14px;
  color: #222;
  margin-top: 4px;
}
.rd-pub {
  margin-top: 6px;
  font-size: 14px;
}
.rd-pub a {
  color: #0b63a8;
  font-weight: 600;
  text-decoration: none;
}
.rd-pub a:hover {
  text-decoration: underline;
}
.rd-actions {
  margin-top: 8px;
}
.rd-actions .rd-download-btn {
  background: #0b79d0;
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

/* pagination */
.rd-pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.rd-page-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background: #fff;
  cursor: pointer;
}
.rd-page-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}
.rd-page-info {
  font-weight: 600;
  color: #222;
}
