/* =========================================================
   DISPLAY DATA — PAGE-SPECIFIC STYLES ONLY
   (Layout + Sidebar + Record Document)
========================================================= */


/* =========================================================
   SCREEN READER UTILITY
========================================================= */

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


/* =========================================================
   PAGE LAYOUT
========================================================= */

.page-layout {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  gap: 20px;
}


/* =========================================================
   FILTER SIDEBAR
========================================================= */

.filter-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--nhs-blue);
  color: var(--text-inverse);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.filter-sidebar fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.filter-sidebar form {
  display: flex;
  flex-direction: column;
}

.filter-sidebar label {
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-inverse);
}

.filter-sidebar label:first-child {
  margin-top: 0;
}

.filter-sidebar select,
.filter-sidebar input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
  margin-bottom: 12px;
}

.filter-sidebar select:focus,
.filter-sidebar input[type="text"]:focus {
  outline: none;
  border-color: #FFD200;
  box-shadow: 0 0 0 3px rgba(255,210,0,0.6);
}

.filter-sidebar button {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  background-color: #1e6bb8;
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-sidebar button:hover {
  background-color: #FFD200;
  color: #003087;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}


/* =========================================================
   RECORD DOCUMENT
========================================================= */

.record-document {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 22px 22px 8px 22px;
  box-shadow: var(--shadow-soft);
  margin: 0 0 28px 0;
  position: relative;
}

.record-document::before {
  content: none !important;
}

.record-document .field-container,
.record-document .inline-field-container {
  background: transparent;
  border-left: none !important;
  padding: 12px 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-theme="dark"] .record-document .field-container,
[data-theme="dark"] .record-document .inline-field-container {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.record-document .field-container:last-of-type,
.record-document .inline-field-container:last-of-type {
  border-bottom: none;
}

.record-document .field-name {
  min-width: 220px;
  color: var(--nhs-blue);
  font-weight: 700;
  margin: 0;
}

[data-theme="dark"] .record-document .field-name {
  color: #9cc6ff;
}

.record-document .field-value {
  margin: 0;
  color: var(--text-primary);
}


/* =========================================================
   DISPLAY STUDY HEADER
========================================================= */

.display-study-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.display-study-image {
  margin-right: 80px;
  margin-top: 8px;
  border: 3px solid var(--nhs-blue);
  border-radius: 12px;
  padding: 20px;
  background: var(--bg-section);
}

.display-study-image img {
  max-width: 180px;
  height: auto;
  display: block;
}


/* =========================================================
   FULL TITLE BLOCK
========================================================= */

.full-title-block {
  margin: 30px 0 20px 0;
  padding: 16px 18px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.full-title-block .inline-field-container {
  padding: 0;
  margin: 0 0 10px 0;
  border: none;
  background: transparent;
}

.full-title-value {
  font-size: 18px;
  line-height: 1.6;
  width: 100%;
  color: var(--text-primary);
}


/* =========================================================
   COLLAPSIBLE
========================================================= */

.collapsible-content {
  max-height: 140px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
  max-height: 2000px;
}

.read-more-button {
  display: inline-block;
  margin-top: 10px;
  background-color: var(--nhs-blue);
  color: var(--text-inverse);
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 14px;
}

.read-more-button:hover {
  background-color: #FFD200;
  color: #003087;
}


/* =========================================================
   BOOLEAN SECTION
========================================================= */

.boolean-row {
  display: flex;
  gap: 20px;
  margin: 25px 0 15px 0;
  flex-wrap: wrap;
}

.boolean-box {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  background: var(--bg-section);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.boolean-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--nhs-blue);
}

[data-theme="dark"] .boolean-title {
  color: #9cc6ff;
}

.boolean-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.boolean-title.yes .boolean-icon { background-color: #007f3b; }
.boolean-title.no .boolean-icon { background-color: #c00000; }
.boolean-title.unknown .boolean-icon { background-color: #6c757d; }


/* =========================================================
   HOSPITAL INFO BOX
========================================================= */

.hospital-info-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  margin: 30px 0;
  padding: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.hospital-info-left { flex: 1; }

.hospital-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.hospital-address {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hospital-image {
  max-width: 360px;
  height: auto;
  border-radius: 12px;
  display: block;
}


/* =========================================================
   CALENDAR SECTION
========================================================= */

.calendar-section {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  margin: 30px 0;
  flex-wrap: wrap;
}

.calendar-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.calendar-label {
  font-weight: 600;
  color: var(--nhs-blue);
  min-width: 160px;
}

[data-theme="dark"] .calendar-label {
  color: #9cc6ff;
}

.calendar-card {
  width: 90px;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

.calendar-month {
  background: var(--nhs-blue);
  color: var(--text-inverse);
  font-size: 12px;
  padding: 6px 0;
}

.calendar-day {
  font-size: 28px;
  font-weight: 700;
  padding: 10px 0;
  background: var(--bg-card);
  color: var(--text-primary);
}

.calendar-year {
  font-size: 12px;
  padding: 6px 0;
  background: var(--bg-section);
  color: var(--text-secondary);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

  .hospital-info-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .hospital-image {
    max-width: 100%;
    margin-top: 20px;
  }

  .calendar-section {
    flex-direction: column;
    gap: 30px;
  }
}

@media (max-width: 768px) {

  .page-layout {
    flex-direction: column;
    padding: 10px;
    gap: 15px;
  }

  .filter-sidebar {
    width: 100%;
    min-width: auto;
    padding: 15px;
    order: 1;
  }

  .main-content {
    width: 100%;
    padding: 15px;
    order: 2;
  }

  .record-document .field-container,
  .record-document .inline-field-container {
    flex-direction: column;
    gap: 8px;
  }

  .record-document .field-name {
    min-width: auto;
    font-size: 14px;
  }

  .record-document .field-value {
    font-size: 14px;
  }

  .read-more-button {
    width: 100%;
    text-align: center;
    font-size: 14px;
  }

  .filter-sidebar select,
  .filter-sidebar input,
  .filter-sidebar button {
    font-size: 16px;
  }
}

@media (max-width: 480px) {

  .page-layout {
    padding: 5px;
  }

  .filter-sidebar,
  .main-content {
    padding: 10px;
  }
}


/* =========================================================
   PRINT
========================================================= */

@media print {

  .record-document {
    box-shadow: none;
    page-break-inside: avoid;
    margin: 0 0 16px 0;
  }

  header,
  .filter-sidebar,
  .nhs-nav,
  .bluebarThin {
    display: none !important;
  }

  body {
    background: #fff;
  }
}


/* ==========================================
   COPY BUTTON IMPROVEMENT
========================================== */

.copy-btn{
    margin-left:8px;
    border:1px solid #ccc;
    background:#f7f7f7;
    border-radius:4px;
    padding:3px 6px;
    cursor:pointer;
    transition:all 0.2s ease;
}

.copy-btn:hover{
    background:#e9f3ff;
    border-color:#005eb8;
}

.copy-btn i{
    font-size:13px;
}

.copy-btn.copied{
    background:#e6f6ea;
    border-color:#2e7d32;
    color:#2e7d32;
    transform:scale(1.1);
}

/* ==========================================
   COPY TOOLTIP
========================================== */

.copy-btn{
    position:relative;
}

.copy-tooltip{

    position:absolute;
    top:-28px;
    left:50%;
    transform:translateX(-50%);

    background:#005eb8;
    color:#fff;

    font-size:11px;
    padding:3px 6px;
    border-radius:4px;

    white-space:nowrap;

    animation:fadeOut 1.5s forwards;
}

@keyframes fadeOut{
    0%{opacity:1;}
    70%{opacity:1;}
    100%{opacity:0;}
}

.contact-info-box {
    border-left: 6px solid #005EB8;
    background: #f0f7ff;
    padding: 18px 20px;
    margin-top: 24px;
    border-radius: 6px;
}

.contact-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #005EB8;
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.contact-info-header i {
    font-size: 1.4rem;
}

.contact-info-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #003a66;
}