/* ==========================================================================
   GLOBAL THEME CONFIGURATIONS & MASTER ROOT VARIABLES
   ========================================================================== */
:root {
  --primary-color: #0056b3;
  --bg-color: #f4f6f9;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-color: #dee2e6;
  --accent-color: #28a745;
  --section-border: #b0c4de;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px 15px;
}

/* Master Sequential Block Container Layer Control */
.search-container, .howto-container, .trouble-container, .docs-container {
  max-width: 950px;
  margin: 0 auto 30px auto;
  background: var(--card-bg);
  padding: 25px;
  border-radius: 8px;
  border: 2px solid var(--section-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  display: block;
}

/* Section Header Design System */
.section-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--section-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header-wrap h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #222;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header-wrap h2 svg {
  color: var(--primary-color);
  flex-shrink: 0;
}
/* ==========================================================================
   INPUT FORM CONTROL SYSTEMS & DIRECTORY LOG TABLES
   ========================================================================== */
.form-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
}

select {
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: #fff;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  flex-grow: 1;
}

@media (min-width: 600px) {
  select { flex-grow: 0; }
}

input[type="text"] {
  flex: 2;
  min-width: 200px;
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
}

button {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-grow: 1;
}

@media (min-width: 480px) {
  button { flex-grow: 0; }
}

button:hover { opacity: 0.9; }
.btn-search { background-color: var(--primary-color); color: white; }
.btn-reset { background-color: #6c757d; color: white; }

.results-info { font-size: 14px; color: #666; margin-bottom: 15px; font-style: italic; }
.results-wrapper { overflow-x: auto; overflow-y: auto; border: 1px solid transparent; transition: max-height 0.2s, border-color 0.2s; border-radius: 4px; }
.results-wrapper.scrollable { max-height: 500px; border-color: var(--border-color); box-shadow: inset 0 0 8px rgba(0,0,0,0.03); }

table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th { background-color: #f1f3f5; color: #495057; font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border-color); }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
tbody tr { cursor: pointer; transition: background-color 0.1s; }
tbody tr:hover { background-color: #eaeefb !important; }
.no-results { padding: 20px; text-align: center; color: #dc3545; font-weight: bold; }
.empty-state { padding: 30px 10px; text-align: center; color: #6c757d; font-style: italic; font-size: 14px; }
/* ==========================================================================
   SECTION BUTTON GRIDS, TILE ARCHITECTURES, & ACTION HOVERS
   ========================================================================== */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  width: 100%;
}

.btn-howto {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #ced4da;
  padding: 15px 20px;
  font-size: 15px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  height: 100%;
  box-sizing: border-box;
  font-weight: 500;
}

.btn-howto:hover {
  background-color: #eaeefb;
  color: var(--primary-color);
  border-color: var(--section-border);
}

.btn-howto svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Subsection Troubleshooting Matrix Elements */
.trouble-category {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.trouble-category h3 {
  font-size: 0.95rem;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
}

.trouble-grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
}

@media (max-width: 850px) {
  .trouble-grid-layout { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .trouble-grid-layout { grid-template-columns: 1fr; }
}

.btn-trouble-tile {
  background-color: #ffffff;
  color: #333333;
  border: 1px solid #ced4da;
  padding: 20px 15px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  min-height: 110px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-trouble-tile:hover {
  background-color: #eaeefb;
  color: var(--primary-color);
  border-color: var(--section-border);
  transform: translateY(-2px);
}

.btn-trouble-tile svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
/* ==========================================================================
   INTERNAL ROUTER PANEL LISTS & DOCUMENT DISTRIBUTION CELL TILES
   ========================================================================== */
.trouble-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.btn-menu-option {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-menu-option:hover {
  background-color: #eaeefb;
  border-color: var(--primary-color);
  color: var(--primary-color);
  padding-left: 20px;
}

.btn-menu-option::after {
  content: "→";
  font-weight: bold;
  color: #6c757d;
}

.btn-menu-option:hover::after { color: var(--primary-color); }

.btn-back-to-menu {
  background-color: #6c757d;
  color: #ffffff;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  width: auto;
}

/* Printable Form Distribution Channels */
.doc-search-box { position: relative; min-width: 260px; }
.doc-search-box input { width: 100%; padding: 8px 12px 8px 32px; font-size: 14px; border: 1px solid #ced4da; border-radius: 4px; outline: none; box-sizing: border-box; }
.doc-search-box input:focus { border-color: var(--primary-color); }
.doc-search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: #6c757d; }

.docs-category { background: #f8f9fa; border: 1px solid var(--border-color); border-radius: 6px; padding: 15px; margin-bottom: 20px; }
.docs-category:last-of-type { margin-bottom: 0; }
.docs-category h3 { font-size: 0.95rem; color: #495057; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0; margin-bottom: 12px; border-left: 4px solid var(--primary-color); padding-left: 10px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.btn-doc-link {
  background-color: #ffffff;
  color: #495057;
  border: 1px solid #ced4da;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-doc-link:hover { background-color: #eaeefb; color: var(--primary-color); border-color: var(--section-border); }
.btn-doc-link svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.doc-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
/* ==========================================================================
   DYNAMIC STEP TIMELINES, MEDIA MODALS, & RESPONSIVE REFINEMENTS
   ========================================================================== */
.walkthrough-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.walkthrough-title-area {
  flex: 1;
  min-width: 200px;
}

.walkthrough-title-area h4 {
  margin: 0 !important;
  color: var(--primary-color);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.walkthrough-alert-box {
  background-color: #e2f0fd;
  border: 1px solid #b8daff;
  color: #004085;
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 13px;
  max-width: 340px;
  box-sizing: border-box;
  font-family: monospace;
  white-space: pre-line;
}

.walkthrough-timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.walkthrough-step-row {
  margin-bottom: 12px;
  color: #333333;
}

.walkthrough-step-text {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 8px;
  font-weight: 500;
}

.walkthrough-step-text strong.step-num {
  color: var(--primary-color);
  font-size: 16px;
  margin-right: 4px;
}

.walkthrough-category-divider {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding-top: 10px;
}

/* Biometrics Zoom Container Options */
.zoomable-img-container {
  display: inline-block;
  cursor: zoom-in;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px;
  background: #ffffff;
  transition: all 0.2s ease-in-out;
  max-width: 100%;
}

.zoomable-img-container:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.zoomable-img-container img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  height: auto;
  transition: max-height 0.25s ease-in-out;
}

.zoomable-img-container.expanded {
  cursor: zoom-out;
  border-color: var(--primary-color);
  width: 100%;
}

.zoomable-img-container.expanded img {
  max-height: 60vh;
}

/* Production Modal View Overlays */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease-in-out !important;
  padding: 15px !important;
  box-sizing: border-box !important;
}

.modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-card {
  background: #ffffff !important;
  width: 100% !important;
  max-width: 650px !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 85vh !important;
  transform: translateY(-20px) !important;
  transition: transform 0.2s ease-out !important;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) !important;
}

.modal-header {
  padding: 15px 20px !important;
  background-color: #f1f3f5 !important;
  border-bottom: 1px solid var(--border-color) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
}

.modal-header h3 {
  margin: 0 !important;
  font-size: 1.15rem !important;
  color: #111 !important;
}

.modal-close-btn {
  background: none !important;
  border: none !important;
  font-size: 28px !important;
  cursor: pointer !important;
  color: #666 !important;
  padding: 0 !important;
  width: auto !important;
  line-height: 1 !important;
}

.modal-close-btn:hover {
  color: #dc3545 !important;
}

.modal-body {
  padding: 20px !important;
  overflow-y: auto !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
}

.modal-body h4 {
  margin-top: 0 !important;
  color: var(--primary-color) !important;
  border-bottom: 1px solid #eee !important;
  padding-bottom: 5px !important;
  text-transform: uppercase !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.5px !important;
}

.modal-body ol {
  margin: 0 !important;
  padding-left: 20px !important;
}

.modal-body li {
  margin-bottom: 12px !important;
}

.modal-body ul {
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  padding-left: 20px !important;
  list-style-type: square !important;
}

.highlight-val {
  background-color: #fff3cd !important;
  color: #856404 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  font-weight: 600 !important;
  font-family: monospace !important;
  font-size: 14px;
}

.instruction-block {
  white-space: pre-line !important;
  font-size: 14px !important;
  color: #333 !important;
  background: #f8f9fa !important;
  padding: 15px !important;
  border-left: 4px solid #6c757d !important;
  border-radius: 4px !important;
}

/* Mobile Responsive Matrix Layout Adapters */
@media screen and (max-width: 650px) {
  table, thead, tbody, th, td, tr { 
    display: block; 
  }
  thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  tr { 
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    padding: 5px;
  }
  td { 
    border: none;
    border-bottom: 1px dashed #eee; 
    position: relative;
    padding-left: 45% !important; 
    text-align: left;
    white-space: normal;
    min-height: 20px;
  }
  td:last-child {
    border-bottom: none;
  }
  td:before { 
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40%; 
    padding-right: 10px; 
    white-space: nowrap;
    font-weight: bold;
    color: #555;
  }
  td:nth-of-type(1):before { content: "Auth #:"; }
  td:nth-of-type(2):before { content: "Company:"; }
  td:nth-of-type(3):before { content: "Request:"; }
  td:nth-of-type(4):before { content: "Trans:"; }
  td:nth-of-type(5):before { content: "Reason:"; }
  td:nth-of-type(6):before { content: "ORI #:"; }
  td:nth-of-type(7):before { content: "CC Auth #:"; }
  td:nth-of-type(8):before { content: "Position:"; }
}
