/* =========================================================
   PAB-A Clinical Protocol (DOCX 1:1) Stylesheet
   ========================================================= */

:root {
  --protocol-primary: #2f75b5;
  --protocol-primary-dark: #1f5689;
  --protocol-primary-light: #d9eaf7;
  --protocol-primary-bg: #eef5fa;
  --protocol-text: #1e293b;
  --protocol-text-muted: #64748b;
  --protocol-border: #cbd5e1;
  --protocol-border-light: #e2e8f0;
  --protocol-accent-bg: #f8fbfd;
  --protocol-warning-bg: #fffbeb;
  --protocol-warning-border: #fcd34d;
  --protocol-warning-text: #92400e;
}

/* Base Document Layout */
.protocol-standalone-body {
  background: #f1f5f9;
  color: var(--protocol-text);
  font-family: 'Heebo', 'Rubik', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Sticky Action Bar */
.protocol-sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--protocol-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 0.75rem 1.5rem;
}

.protocol-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.protocol-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.protocol-nav-brand strong {
  background: var(--protocol-primary);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.protocol-nav-brand span {
  font-size: 0.9rem;
  color: var(--protocol-text-muted);
  font-weight: 500;
}

.protocol-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--protocol-border);
  background: #ffffff;
  color: var(--protocol-text);
}

.btn-nav-action:hover {
  background: #f8fafc;
  border-color: var(--protocol-primary);
  color: var(--protocol-primary);
}

.btn-nav-action.btn-print {
  background: var(--protocol-primary);
  border-color: var(--protocol-primary);
  color: #ffffff;
}

.btn-nav-action.btn-print:hover {
  background: var(--protocol-primary-dark);
}

.protocol-toc-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--protocol-border-light);
}

.protocol-toc-links a {
  font-size: 0.82rem;
  color: #475569;
  text-decoration: none;
  background: #f1f5f9;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.protocol-toc-links a:hover {
  background: var(--protocol-primary-light);
  color: var(--protocol-primary-dark);
  font-weight: 600;
}

/* Paper Container */
.protocol-container {
  max-width: 1100px;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1rem;
}

.protocol-paper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--protocol-border-light);
  padding: 3rem 3.5rem;
}

@media (max-width: 768px) {
  .protocol-container {
    padding: 0 0.5rem;
    margin: 1rem auto 2rem auto;
    width: 100%;
    max-width: 100vw;
  }

  .protocol-paper {
    padding: 1.25rem 0.75rem;
    border-radius: 8px;
  }

  .protocol-main-title {
    font-size: 1.45rem;
  }

  .protocol-hero-badge {
    font-size: 0.95rem;
    padding: 0.25rem 0.85rem;
  }

  .protocol-sticky-nav {
    padding: 0.5rem 0.75rem;
  }

  .protocol-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .protocol-toc-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .protocol-toc-links::-webkit-scrollbar {
    display: none;
  }

  .protocol-toc-links a {
    white-space: nowrap;
    font-size: 0.78rem;
  }
}

/* Hero Badge & Main Title */
.protocol-hero-badge {
  display: inline-block;
  background: var(--protocol-primary);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0.35rem 1.25rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: 1px;
}

.protocol-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.25rem 0 0.5rem 0;
  line-height: 1.3;
}

.protocol-doc-meta {
  color: var(--protocol-text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--protocol-border-light);
}

/* Banner Headers (Major Section Header) */
.protocol-banner-header {
  background: var(--protocol-primary);
  color: #ffffff;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin: 2.25rem 0 1.25rem 0;
  box-shadow: 0 2px 6px rgba(47, 117, 181, 0.25);
  scroll-margin-top: 90px;
}

.protocol-banner-header h2 {
  color: #ffffff !important;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

/* Headings */
.protocol-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  border-right: 4px solid var(--protocol-primary);
  padding-right: 0.75rem;
  margin: 1.75rem 0 0.85rem 0;
  line-height: 1.4;
  scroll-margin-top: 90px;
}

.protocol-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  margin: 1.25rem 0 0.5rem 0;
}

.protocol-transcription-title {
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: #334155;
  font-weight: 600;
}

.protocol-p {
  margin: 0.6rem 0;
  font-size: 0.96rem;
  line-height: 1.6;
}

/* Instruction & Callout Boxes */
.protocol-instruction-box {
  background: var(--protocol-primary-bg);
  border-right: 4px solid var(--protocol-primary);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.25rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1e293b;
}

.protocol-info-box {
  background: #f8fafc;
  border: 1px solid var(--protocol-border-light);
  border-radius: 8px;
  padding: 0.9rem 1.2rem;
  margin: 1rem 0;
}

.protocol-callout-bar {
  background: #f8fafc;
  border: 1.5px solid var(--protocol-border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  color: #1e293b;
}

.protocol-subtotal-bar {
  background: #f0fdf4;
  border: 1.5px dashed #22c55e;
  color: #166534;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  margin: 1.25rem 0;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
}

/* Bullet list */
.protocol-bullet-list {
  margin: 0.4rem 0 0.2rem 1.25rem;
  padding: 0;
  list-style-type: disc;
}

.protocol-bullet-list li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.lead-text {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Ruled Writing Lines */
.protocol-ruled-line {
  height: 32px;
  border-bottom: 1.5px dashed #cbd5e1;
  margin: 2px 0;
  position: relative;
}

.protocol-ruled-line::after {
  content: "";
  display: block;
}

/* Checkboxes */
.paper-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 2px 4px;
  padding: 2px 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.9rem;
  user-select: none;
}

/* Protocol Tables */
.protocol-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 1.25rem 0 1.75rem 0;
  border-radius: 8px;
  border: 1px solid var(--protocol-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.protocol-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: right;
  direction: rtl;
}

.protocol-table th,
.protocol-table td {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--protocol-border-light);
  vertical-align: top;
  line-height: 1.5;
}

.protocol-table th.th-primary {
  background: var(--protocol-primary);
  color: #ffffff;
  font-weight: 700;
  border-color: var(--protocol-primary-dark);
  text-align: right;
}

.protocol-table th.th-sub,
.protocol-table td.th-sub {
  background: var(--protocol-primary-light);
  color: #1e3a8a;
  font-weight: 700;
  border-color: #bfdbfe;
}

.protocol-table td.td-accent {
  background: var(--protocol-accent-bg);
}

.protocol-table td.td-warning {
  background: var(--protocol-warning-bg);
  color: var(--protocol-warning-text);
}

.protocol-table tbody tr:hover td {
  background-color: rgba(241, 245, 249, 0.6);
}

/* Print Styles - Form is strictly NOT for printing */
@media print {
  body * {
    display: none !important;
  }
  body::before {
    content: "טופס זה הינו לצפייה דיגיטלית בלבד ואינו מיועד להדפסה.";
    display: block !important;
    text-align: center;
    padding: 6rem 2rem;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Heebo', sans-serif;
    color: #1e293b;
    direction: rtl;
  }
}