/*--Page Layout--*/
.page {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 1100px;
    height: auto;
    margin: 30px auto;
    background-image: url('newbackground.png');
    background-color: white;
    /* Change background-size to force stretching */
    background-size: 100% 100%; /* Stretch to fill width and height */
    background-position: center top; /* Position remains the same */
    background-repeat: no-repeat;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 38, 61, 0.08);
    border: 0px solid #ffffff;
    padding: 40px 40px 40px 40px;
    box-sizing: border-box;
  }
  
  /* Remove background image ONLY for the BMI page */
  .page.bmi-page {
    background-image: none;
  }
  
      .page.simple {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
      .page.summary {
    padding-top: 70px;
  }
  
      .page-title {
    color: #003b59;
    font-size: 42px; /* Bigger like you want */
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 38, 61, 0.15);
    margin-bottom: 10px;
    margin-top: 0;
  }
  
      .subtitle-text {
    color: #003b59;
    font-size: 36px; /* Smaller than main title */
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 1px 2px rgba(0, 38, 61, 0.1);
  }
  
  
  
  /* Ensure content sits above the overlay */
  .page > * {
    position: relative;
    z-index: 1;
  }
  
      /* --- Page Elements --- */
   /* --- Title Text --- */
  .title-text {
    color: #003b59;
    font-size: 38px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 38, 61, 0.15);
    padding: 12px 20px;
    border-radius: 0; /* Remove rounding since background is gone */
    margin-top: 35px; /* Default top margin */
    background: none; /* ← Remove background */
  }
  /* --- Client Name and Exam Date --- */  
  #clientName, #examDate {
    font-size: 28px; /* Closer to main title size */
    font-weight: 600;
    color: #003b59;
    background: none; /* No background */
    text-align: center;
    margin-top: 15px; /* Space between title and name/date */
    margin-bottom: 10px; /* Extra space after each field */
    padding: 0; /* No extra padding */
  }
  
      /* --- Navigation --- */
      .return-link {
        position: fixed;
        top: 15px;
        left: 15px;
        background-color: #c19962;
        color: white;
        padding: 8px 15px;
        border-radius: 4px;
        text-decoration: none;
        font-weight: bold;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        z-index: 1000;
        transition: background-color 0.2s ease;
      }
  
      /* --- Buttons --- */
      button {
        display: block; /* Make button block */
        margin: 40px auto 20px auto; /* Center button below content */
        padding: 12px 28px;
        font-size: 16px;
        background-color: #c19962;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s ease;
      }
  
      /* Combined Hover State for Link and Button */
      .return-link:hover,
      button:hover {
        background-color: #a98451;
      }
  
  /* --- Form Inputs & Fields --- */
  .meta-field, .value-field {
    font-size: 16px;
    color: #00263d;
    background-color: #ffffff; /* Solid white background */
    border: 1px solid #c19962; /* Gold border */
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 38, 61, 0.05);
    text-align: center; /* Center the text */
    font-weight: 600; /* Make text bold */
    transition: box-shadow 0.2s ease;
  }
  
  .meta-field {
    width: 70%;
  }
  
  .value-field {
    width: 85%;
  }
  
      /* Specific adjustments for inputs directly under graph-container */
      .graph-container > .value-field {
          display: inline-block; /* Allow inline display */
          width: 120px; /* Fixed width for consistency */
          margin: 10px;
      }
  
      .unit-label {
        font-size: 14px; /* Match value field */
        margin-left: 5px; /* Reduced margin */
        vertical-align: middle;
        color: #555; /* Slightly dimmer color */
      }
  
  /* --- Tables --- */
  .table-wrapper {
    width: 95%;
    margin: 20px auto;
    overflow-x: auto;
  }
  
  .table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #ffffff; /* Full white background for the entire table */
  }
  
  .table-wrapper th,
  .table-wrapper td {
    padding: 8px 10px;
    border: 1px solid #c19962;
    text-align: center; /* Ensure all table cells default to center alignment */
    vertical-align: middle;
    background-color: #ffffff !important; /* Force white background on all cells */
  }
  
  .table-wrapper th {
    background-color: #fdf6ec !important; /* Soft gold for header only */
    font-weight: bold;
  }
  
  .table-wrapper td:nth-child(1) {
    font-weight: 600;
    white-space: nowrap;
  }
  
  /* Ensure input fields within tables are centered and align vertically */
  .table-wrapper input.value-field,
  .table-wrapper textarea.value-field { /* Apply base styles to textarea too */
    width: 90%; /* Default width */
    box-sizing: border-box;
    background-color: #ffffff !important;
    font-family: inherit; /* Use consistent font */
    font-size: 14px; /* Match table font size */
    color: #00263d; /* Match input text color */
    border: 1px solid #c19962;
    padding: 10px 16px; /* Match input padding */
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 38, 61, 0.05);
    text-align: center; /* Center text WITHIN the input */
    font-weight: 600; /* Match input weight */
    vertical-align: middle; /* Align input box vertically */
    display: inline-block; /* Needed for vertical-align to work reliably with span */
    margin: 0 3px; /* Add slight spacing around input */
  }
  
  /* Ensure unit labels align vertically with inputs */
  .table-wrapper .unit-label {
    display: inline-block; /* Needed for vertical-align */
    vertical-align: middle; /* Align span vertically with input */
    font-size: 14px;
    color: #555;
  }
  
  
  /* Specific styles for the note textareas */
  .table-wrapper textarea.note-field {
    width: 100%; /* Fill the cell width */
    height: auto; /* Allow height to adjust based on content */
    min-height: 40px; /* Minimum height similar to single-line inputs */
    resize: none; /* Disable manual resizing by user */
    overflow: hidden; /* Hide scrollbars, height will adjust */
    white-space: normal; /* Allow text wrapping */
    text-align: center; /* Align note text center */
    padding-top: 8px; /* Fine-tune padding */
    padding-bottom: 8px;
    display: block; /* Make textarea block to fill width */
    margin: 0 auto; /* Center block element */
  }
  
  /* Adjust the 'Note' column cells in the summary table */
  .page.summary .table-wrapper td:nth-child(3) {
    vertical-align: top; /* Align textarea to the top of the cell */
  }

  .table-wrapper td.note-cell-blank {
    background-color: #fdf6ec !important;
  }

  .table-wrapper td.note-cell-blank textarea.note-field {
    background-color: #fdf6ec !important; /* Match the cell background */
    border: none !important; /* Remove border for a seamless infill */
    box-shadow: none !important; /* Remove shadow for a seamless infill */
}

  /* --- Graph & Chart Containers --- */
  .graph-container {
    position: relative;
    width: 90%;
    margin: 30px auto;
    padding: 24px;
    border-radius: 10px;
    background-color: transparent; /* Let the background image show through */
    border: none; /* Remove border so it blends naturally */
    text-align: center;
    box-shadow: none; /* Remove shadow to reduce overlay clutter */
  }
  
  /* Chart Grid Layout */
  .charts-grid {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally within the column */
    gap: 20px; /* Space between cards */
    margin: 20px auto 20px auto;
  }
  
  /* Chart Canvas Container */
  .chart-container {
    position: relative;
    width: 100%;
    height: 250px; /* Default height */
    background-color: transparent;
  }
  
  /* Individual Chart Card Styling */
  .chart-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 38, 61, 0.06);
    padding: 20px;
    box-sizing: border-box;
    width: 90%; /* Make cards take up most of the container width */
    max-width: 600px; /* Optional: Prevent cards from becoming excessively wide */
    /* Removed flex-basis and max-width related to grid layout */
  }
  
  /* Specific styles for BMI charts */
  #bmi-charts-grid .chart-card {
    /* Remove properties that forced 2-column layout */
    /* flex-basis: calc(50% - 12px); */ /* Removed */
    /* max-width: calc(50% - 12px); */ /* Removed */
    width: 90%; /* Ensure it takes significant width */
    max-width: 600px; /* Keep a reasonable max width */
    padding: 15px;
  }
  
  #bmi-charts-grid .chart-container {
    height: 200px; /* Keep reduced height */
  }
  
  /* RMR Comparison Visualization Styles */
  .rmr-comparison {
    width: 100%;
    margin: 20px auto 30px auto;
  }
  
  .rmr-percent-diff {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    color: #003b59;
  }
  
  .bar-container {
    display: flex;
    border: 1px solid #c19962;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 38, 61, 0.08);
  }
  
  .segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 5px;
    position: relative;
    transition: all 0.3s ease;
  }
  
  .segment .title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
  }
  
  .segment .subtitle {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
  }
  
  .much-lower { background-color: #d67c62; }
  .lower      { background-color: #f9dead; }
  .exact      { background-color: #e0f0d8; }
  .higher     { background-color: #b3d59c; }
  .much-higher{ background-color: #6fa544; }
  
  /* Updated highlight style: less intense, gold BORDER, no animation */
  .segment.highlight {
    /* Remove outline properties */
    /* outline: 4px solid #c19962; */
    /* outline-offset: -2px; */
  
    /* Use a thicker border for the highlight effect */
    border: 5px solid #003b59; /* Gold border, 4px thick */
  
    box-shadow: 0 6px 12px rgba(0, 38, 61, 0.15); /* Softer shadow */
    z-index: 10;
    position: relative;
    font-weight: bold;
    /* Removed background-image gradient */
    /* Removed animation property */
  }
  
  .segment.highlight .title {
    font-size: 16px; /* Slightly larger than default */
    color: #00263d; /* Darker text for contrast on lighter backgrounds */
    /* Removed text-shadow */
    letter-spacing: 0.2px;
  }
  
  .segment.highlight .subtitle {
    font-size: 11px; /* Keep subtitle size consistent */
    font-weight: normal; /* Normal weight */
  }
  
  /* Less intense de-emphasis for other segments */
  .segment:not(.highlight) {
    opacity: 0.9; /* Slightly reduced opacity */
    filter: saturate(0.95); /* Minimal de-saturation */
    transform: scale(1); /* No scaling */
  }
  
  /* --- Nutrition Targets Page Specific Styles --- */
  
  /* Center the dietary assumptions section */
  .selected-macros {
    width: 100%; /* Take full width to allow inner centering */
    max-width: 700px; /* Adjust max-width as needed */
    margin: 1px auto 20px auto; /* Center the block horizontally, add vertical spacing */
    text-align: center; /* Center the subtitle */
  }
  
  .section-subtitle {
    color: #003b59;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
  }
  
  /* Use flexbox to center the assumption items */
  .macro-items-container {
    display: flex;
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Align items vertically */
    flex-wrap: wrap; /* Allow wrapping if needed */
    gap: 30px; /* Space between assumption items */
  }
  
  /* Style individual assumption items */
  .macro-item {
    display: flex; /* Align label, input, unit horizontally */
    align-items: center; /* Vertically align items in the row */
    gap: 8px; /* Space between label, input, unit */
  }
  
  .macro-label {
    font-weight: 600;
    white-space: nowrap; /* Prevent label text wrapping */
  }
  
  /* Narrow the input fields specifically within the selected-macros section */
  .selected-macros .value-field {
    width: 100px; /* Set a fixed smaller width */
    /* Override the default width: 85% */
    flex-shrink: 0; /* Prevent shrinking if container is tight */
  }
  
  /* Ensure unit labels in this section align correctly */
  .selected-macros .unit-label {
    /* Styles inherited from general .unit-label should be sufficient */
    white-space: nowrap;
  }

  /* Style for functional strength scores container and rows */
  .functional-strength-container .strength-score-row {
    width: 400px;
    margin: 0 auto 10px auto;
    display: grid;
    grid-template-columns: 1fr 150px; /* Split into two columns with fixed width for inputs */
    align-items: center;
    gap: 15px; /* Space between label and input */
  }

  /* Style for the labels in strength score rows */
  .functional-strength-container .strength-score-row {
    text-align: right; /* Right-align the row content */
  }

  /* Style for the input fields in functional strength scores */
  .functional-strength-container .strength-score-row input.value-field {
    text-align: center;
    width: 120px;
    margin: 0;
    justify-self: end; /* Align to the end (right) of the grid cell */
    display: inline-block;
  }

/* --- Metabolic Data Styles --- */
#metabolic-data-section {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Match data-group with your existing container styles */
.data-group {
  margin-bottom: 25px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
  /* Integrate with existing styles */
  box-shadow: 0 2px 5px var(--shadow-color); 
}

/* Input group styling consistent with form elements in base.css */
.input-group {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.input-group label {
  min-width: 200px;
  margin-right: 10px;
  font-weight: 600;
  color: var(--text-color);
}

.input-group input {
  padding: 5px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  width: 100px;
}

/* Zone container styling */
.zone-container {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f0f0f0;
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.zone-inputs {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.zone-inputs .input-group {
  width: 45%;
  min-width: 250px;
}

/* Use the button styling from base.css but add action-button class for specific buttons */
button.action-button {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

button.action-button:hover {
  background-color: #a98451;
}

/* Metabolic Summary Report styles */
#metabolic-summary {
  margin-top: 30px;
}

.report-section {
  margin-bottom: 20px;
}

/* Zone table styling that matches other tables */
.zone-table {
  width: 100%;
  border-collapse: collapse;
}

.zone-table th, .zone-table td {
  border: 1px solid var(--border-color);
  padding: 8px;
  text-align: center;
}

.zone-table th {
  background-color: var(--secondary-light);
  font-weight: bold;
}

.zone-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Download PDF button styling to match other buttons */
#download-pdf {
  margin-top: 20px;
  margin-bottom: 40px;
}