h1,
h2 {
  color: #333;
}

form {
  margin-bottom: 15px;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 8px;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}
body {
  overflow-y: auto; /* Allow the entire page to scroll */
  height: auto; /* Remove fixed height */
  width: 100%;
}
.container {
  display: flex;
  height: calc(
    100vh - 40vh
  ); /* Match the fixed iframe height so no empty gap is left above it */
}

.filters {
  width: 20%;
  padding: 8px; /* Reduced padding */
  border-right: 1px solid #ddd;
  height: 100%;
  overflow-y: auto;
}
.results {
  width: 80%;
  padding: 4px; /* Reduced padding */
  height: 100%; /* Adjust height to make room for the iframe */
  overflow-y: auto; /* Allow the results section to scroll */
}
.results-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* Reduced margin */
}

.results-header {
  font-size: 0.9em; /* Reduce font size */
  margin: 0; /* Remove top margin, keep some bottom margin */
  padding: 0; /* Remove padding */
  color: #333; /* Maintain color consistency */
  font-weight: bold; /* Keep it bold for emphasis */
  line-height: 1;
}

#pairing-iframe-container {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: #fff;
  border-top: 3px solid #ddd;
  height: 40vh; /* Height of the iframe */
}

#pairing-iframe {
  width: 100%;
  height: 100%; /* Fill the container */
  border: none;
  overflow-y: auto; /* Allow the iframe content to scroll */
}

.metrics-header {
  font-size: 1.2em;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #333;
  font-weight: bold;
}

.metrics-container {
  margin-bottom: 25px;
}

.pairing-counts-table {
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 0.9em;
}

.pairing-counts-table th,
.pairing-counts-table td {
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #ddd;
}

.pairing-counts-table th {
  background-color: #f2f2f2;
  font-weight: bold;
  color: #333;
}

.pairing-counts-table td {
  font-weight: 500;
}

.pairing-counts-table tr:hover {
  background-color: #f5f5f5;
}

.filter-group-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  flex-wrap: nowrap;
}

.filter-group-inline label {
  margin-right: 4px;
  font-size: 0.9em; /* Reduce the font size */
}

.filter-group-inline input[type="text"],
.inline-field input[type="text"] {
  width: 50px;
  height: 16px;
  padding: 2px;
  margin-left: 4px;
  font-size: 0.9em; /* Reduce the font size */
  display: none; /* Hide by default */
}

.filter-group-inline input[type="text"].visible,
.inline-field input[type="text"].visible {
  display: inline;
}

.fixed-size-input {
  width: 20px;
  height: 16px;
  padding: 2px;
  font-size: 0.9em; /* Reduce the font size */
}

.filter-group {
  margin-bottom: 12px;
  max-width: 100%;
}

.filter-group label {
  display: block;
  margin-bottom: 4px;
}

.filter-group-inline input[type="checkbox"] {
  margin-right: 8px;
}

.fixed-size-input {
  width: 20px;
  height: 16px;
  padding: 2px;
}

.inline-field {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.inline-field label {
  margin-right: 8px;
  margin-left: 35px;
}

.filter-group input[type="checkbox"] {
  margin-right: 8px;
}

.filter-group input[type="text"] {
  display: block;
  width: 85%;
  padding: 4px;
  margin-top: 4px;
}

.filter-group button {
  display: block;
  width: 100%;
  padding: 8px;
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
}

.results-table-container {
  max-height: 450px; /* Adjust this value as needed */
  overflow-y: auto;
  border: 1px solid #ddd;
}

.results-pairing-table {
  font-family: "Courier New", Courier, monospace;
  width: 100%;
  border-collapse: collapse;
}

.results-pairing-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-pairing-table th,
.results-pairing-table td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: left;
  white-space: nowrap;
}

.results-pairing-table th {
  background-color: #f2f2f2;
}

.results-pairing-table tbody tr:nth-child(even) {
  background-color: #f8f8f8;
}

.results-pairing-table tbody tr:hover {
  background-color: #e8e8e8;
}

.results-pairing-table tbody tr.active-pairing-row {
  box-shadow: inset 0 0 0 2px #2f6fb2;
}

.results-pairing-table tbody tr.active-pairing-row:hover {
  box-shadow: inset 0 0 0 2px #2f6fb2;
}

.results-pairing-table tbody tr.active-pairing-row td:not([data-column="11"]) {
  background-color: #bcdcff !important;
}

.results-pairing-table tbody tr.active-pairing-row td:first-child {
  border-left: 5px solid #2f6fb2 !important;
}

.results-pairing-table tbody tr.active-pairing-row td[data-column="11"] {
  box-shadow: inset 0 0 0 2px #2f6fb2;
}

.results-pairing-table .day {
  width: 45px;
}
.results-pairing-table .flt {
  width: 45px;
}
.results-pairing-table .dep {
  width: 45px;
}
.results-pairing-table .local {
  width: 55px;
}
.results-pairing-table .arr {
  width: 45px;
}
.results-pairing-table .turn {
  width: 55px;
}
.results-pairing-table .eqp {
  width: 45px;
}
.results-pairing-table .block {
  width: 65px;
}
.results-pairing-table .duty {
  width: 75px;
}

.pairing-container {
  display: flex;
  justify-content: space-between;
}

.pairing-details pre {
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap;
  margin: 0;
  padding: 0;
}

.pairing-header {
  width: 100%;
  margin-bottom: 8px;
}

.pairing-header td {
  padding: 6px;
  border: 1px solid #ddd;
  font-family: "Courier New", Courier, monospace;
  white-space: nowrap;
}

.pairing-table {
  font-family: "Courier New", Courier, monospace;
  table-layout: fixed;

  border-collapse: collapse;
}

.pairing-table th,
.pairing-table td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pairing-table th {
  background-color: #f2f2f2;
}

.align-right {
  text-align: right;
}
.align-left {
  text-align: left;
}

.pairing-table .day {
  width: 45px;
}
.pairing-table .flt {
  width: 45px;
}
.pairing-table .dep {
  width: 45px;
}
.pairing-table .local {
  width: 55px;
}
.pairing-table .arr {
  width: 45px;
}
.pairing-table .turn {
  width: 55px;
}
.pairing-table .eqp {
  width: 45px;
}
.pairing-table .block {
  width: 65px;
}
.pairing-table .duty {
  width: 75px;
}

.bold-top {
  border-top: 3px solid #000 !important;
}

.bold-text {
  font-weight: bold;
}

.summary-label {
  font-weight: bold;
  text-align: right;
  padding-right: 8px;
}

.summary-value {
  text-align: left;
  font-weight: bold;
  padding-left: 8px;
}

.summary-table {
  font-family: "Courier New", Courier, monospace;
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.summary-table th,
.summary-table td {
  padding: 6px;
  text-align: left;
  white-space: nowrap;
}

.calendar {
  width: 35%;
  margin-top: 0px;
  margin-right: 15px;
}

.calendar-month {
  text-align: center;
  padding: 8px 0;
  background-color: #f0f0f0;
  border-bottom: 1px solid​ #ddd;
  font-size: 1.1em;
  font-weight: bold;
}

.calendar-header {
  display: flex;
  background-color: #f0f0f0;
  font-weight: bold;
  font-size: 0.8em;
}

.calendar-header div {
  flex: 1;
  text-align: center;
  padding: 4px 0;
  border: 1px solid #ddd;
}

.calendar-body {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #ddd;
}

.calendar-day {
  flex: 1 0 14.28%;
  height: 45px;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  font-size: 0.8em;
}

.calendar-day.empty {
  background-color: #f9f9f9;
}

.calendar-day.operating {
  background-color: #cce5ff;
  font-weight: bold;
}

.calendar-day.other-month {
  background-color: #f5f5f5;
  color: #999;
  font-style: italic;
}

.calendar-day.other-month.operating {
  background-color: #e6f3ff;
  color: #666;
  font-weight: bold;
  font-style: normal;
}

.is-redeye {
  color: #dc3545;
  font-weight: bold;
  font-size: 1em;
}

.wocl-minutes {
  font-size: 0.7em;
  color: #666;
  display: block;
  text-align: center;
}

.redeye-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

#redeye-options {
  display: flex;
  align-items: center;
}

#redeye-options label {
  margin-right: 8px;
}
.commutable-field {
  display: none;
}

.commutable-field.visible {
  display: inline;
}

.table-container {
  overflow-x: auto;
}

.metrics-table {
  width: auto;
  border-collapse: collapse;
  font-size: 0.9em;
  white-space: nowrap;
}

.metrics-table th,
.metrics-table td {
  border: 1px solid #ddd;
  padding: 5px 8px;
  text-align: center;
}

.metrics-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.metrics-table td:first-child {
  text-align: left;
  font-weight: bold;
  background-color: #f8f8f8;
}

.metrics-table small {
  font-size: 0.8em;
  color: #666;
  white-space: nowrap;
}

.metrics-table a {
  color: #0066cc;
  text-decoration: none;
}

.metrics-table a:hover {
  text-decoration: underline;
}
.pairing-length-input {
  width: 35px; /* Adjust this value as needed */
  padding-right: 4px; /* This gives some space for the arrows */
}

.time-input {
  width: 35px;  /* Reduced width to match other time inputs */
  text-align: center;
  margin-left: 4px;
  padding: 2px 4px;
  font-size: 0.9em;
}

#avg_daily_credit_operator {
  width: 75px;
  padding: 2px 4px;
  font-size: 0.9em;
  margin-right: 4px;
}

.avg-daily-credit-fields {
  margin-top: 4px;
  margin-bottom: 4px;
}

.avg-daily-credit-fields .filter-group-inline {
  display: inline-flex;  /* Changed to inline-flex to not span full width */
  align-items: center;
  gap: 4px;
}

.marked-pairing {
  background-color: #ffffcc !important;
}

.mark-checkbox {
  margin-left: 8px;
  vertical-align: middle;
}
.show-marked-only .results-pairing-table tr:not(.marked-pairing):not(.dropdown-row) {
  display: none;
}
.file-controls {
  margin-bottom: 12px;
}

.file-controls a {
  text-decoration: none;
  color: #0066cc;
}

.file-controls a:hover {
  text-decoration: underline;
}

.file-controls {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.file-controls .separator {
  margin: 0 8px;
}

.inline-form {
  display: flex;
  align-items: center;
}

.inline-form label {
  margin-right: 8px;
}

.inline-form select {
  margin-right: 8px;
}
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.file-controls .separator {
  margin: 0 8px;
}

.inline-form {
  display: flex;
  align-items: center;
}

.inline-form label {
  margin-right: 8px;
}

.inline-form select {
  margin-right: 8px;
}

.file-controls a {
  text-decoration: none;
  color: #0066cc;
}

.file-controls a:hover {
  text-decoration: underline;
}
.filters {
  width: 25%;
  padding: 8px;
  border-right: 1px solid #ddd;
}

.pairing-score {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.pairing-score h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
}

.score-breakdown {
    padding: 8px 15px; /* Reduced top/bottom padding from 15px to 8px */
    background-color: #fff;
    border-radius: 4px;
    line-height: 1.4; /* Reduced from 1.6 */
    font-size: 1.1em;
    max-width: 500px; /* Limit overall width */
}

.score-breakdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8em;
}

.score-breakdown li {
    margin: 4px 0; /* Reduced from 8px to 4px */
    padding: 0;
}

.score-breakdown li div:first-child {
    margin-bottom: 2px;
}

.score-breakdown li[data-score-type="positive"] {
    color: #27ae60;
}

.score-breakdown li[data-score-type="negative"] {
    color: #c0392b;
}

.score-breakdown li[data-score-type="neutral"] {
    color: #7f8c8d;
}

.score-breakdown ul li {
    margin-bottom: 15px;
}

.score-bar-container {
    width: 100%;
    background-color: #eaeaea;
    margin-top: 2px; /* Reduced from 4px */
    height: 20px; /* Reduced from 24px */
    border-radius: 4px;
    overflow: hidden;
    font-weight: 600;
    margin-top: 4px;
}

.score-bar {
    height: 100%;
    position: relative;
    padding: 2px 8px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.score-bar.no-shadow {
    text-shadow: none;
}

.score-bar-positive {
    background-color: #2e7d32;
    color: white;
    left: 50%;
}

.score-bar-negative {
    background-color: #d32f2f;
    color: white;
    text-align: center;
}

.score-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    font-weight: 700;
    font-size: 1.15em;
}

.score-breakdown .value {
    font-weight: 600;
    color: #1a1a1a;
}

/* Score percentile styling */
.summary-label strong {
    font-weight: 600;
}

.export-btn {
    background-color: #28a745;
    color: white;
    padding: 3px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

.export-btn:hover {
    background-color: #218838;
}

.export-btn::before {
    content: "⬇";  /* Unicode down arrow */
    font-size: 0.9em;
}

/* Score cell styling */
.score-cell, .summary-value {
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

/* Ensure text is readable on colored backgrounds */
.score-cell[style*="background-color"], 
.summary-value[style*="background-color"] {
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Dark background colors (scores < 50) */
.score-cell[style*="DC7633"],
.score-cell[style*="EC7063"],
.score-cell[style*="E74C3C"],
.score-cell[style*="C0392B"],
.summary-value[style*="DC7633"],
.summary-value[style*="EC7063"],
.summary-value[style*="E74C3C"],
.summary-value[style*="C0392B"] {
    color: white !important;
}

/* Light background colors (scores >= 50) */
.score-cell[style*="2ECC71"],
.score-cell[style*="82E0AA"],
.score-cell[style*="F7DC6F"],
.score-cell[style*="F4D03F"],
.score-cell[style*="F5B041"],
.summary-value[style*="2ECC71"],
.summary-value[style*="82E0AA"],
.summary-value[style*="F7DC6F"],
.summary-value[style*="F4D03F"],
.summary-value[style*="F5B041"] {
    color: black !important;
}

/* Score Bar Chart Styles */
.score-bar-container {
    width: 100%;
    margin: 2px 0;
    position: relative;
    height: 18px;
    background-color: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
    font-weight: 600;
    margin-top: 4px;
}

.score-bar {
    height: 100%;
    position: absolute;
    transition: width 0.5s ease;
}

.score-bar-positive {
    background-color: #4caf50; /* Green for positive scores */
    left: 50%;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.score-bar-negative {
    background-color: #f44336; /* Red for negative scores */
    text-align: center;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.score-bar-neutral {
    background-color: #7f8c8d; /* Gray for neutral scores */
    width: 2px !important;
    left: 50%;
}

.score-bar-label {
    position: absolute;
    top: 0;
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    line-height: 18px;
    color: #333;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.score-breakdown li {
    margin: 8px 0;
    padding: 0;
}

.score-breakdown .score-details {
    font-size: 0.85em;
    color: #666;
    margin-left: 4px;
}

.score-total {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #ddd;
    font-weight: 600;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

/* Tier categorization for marked pairings */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  vertical-align: middle;
}
.tier-badge.tier-1 { background-color: #2e7d32; color: white; }
.tier-badge.tier-2 { background-color: #0066cc; color: white; }
.tier-badge.tier-3 { background-color: #ed6c02; color: white; }
.tier-badge.tier-4 { background-color: #9e9e9e; color: white; }
.tier-badge.tier-5 { background-color: #6a4c93; color: white; }
.tier-badge.tier-6 { background-color: #546e7a; color: white; }
.tier-badge.tier-7 { background-color: #c62828; color: white; }  /* DNF - Do Not Fly */
.tier-badge:hover { opacity: 0.9; }

.score-gate-badge {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: 0.68em;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  vertical-align: baseline;
}

.score-gate-badge.gate-hard_red_flag {
  background-color: #8e1b1b;
}

.score-gate-badge.gate-strong_caution {
  background-color: #9a5b00;
}

.score-gate-badge.gate-stretch_locked {
  background-color: #4c5f7f;
}

.score-gate-badge.gate-mixed {
  background-color: #5f4b8b;
}

/* Tier picker modal */
.tier-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.tier-picker-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 280px;
}
.tier-picker-content h4 { margin: 0 0 8px 0; font-size: 1em; }
.tier-picker-content p { margin: 0 0 12px 0; font-size: 0.9em; color: #666; }
.tier-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tier-picker-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  font-weight: bold;
}
.tier-picker-btn:hover {
  background: #e0e0e0;
}
.tier-picker-dnf {
  background: #ffebee !important;
  color: #c62828;
  border-color: #c62828;
}
.tier-picker-dnf:hover {
  background: #ffcdd2 !important;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.score-label {
    min-width: 100px; /* Reduced from 150px */
    flex-shrink: 0; /* Prevent label from shrinking */
}

.score-bar-container {
    flex-grow: 1; /* Take remaining space */
    min-width: 120px; /* Reduced from 200px */
    max-width: 300px; /* Add maximum width */
}

.label-title {
    font-weight: bold;
    white-space: nowrap; /* Prevent wrapping */
}

.label-details {
    font-size: 0.9em;
    white-space: nowrap; /* Prevent wrapping */
}

.score-bar-container {
    flex-grow: 1;
    background-color: #eaeaea;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
    position: relative;
}

.score-bar {
    height: 100%;
    position: absolute;
    padding: 2px 8px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.score-bar.no-shadow {
    text-shadow: none;
}

.score-bar-positive {
    background-color: #2e7d32;
    color: white;
    left: 50%;
}

.score-bar-negative {
    background-color: #d32f2f;
    color: white;
    text-align: center;
}

.score-breakdown ul li {
    margin-bottom: 8px;
}

.score-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    font-weight: 700;
    font-size: 1.15em;
}

.score-total .score-label {
    min-width: 180px;
}

.score-details {
    font-size: 0.85em;
    margin-left: 8px;
}

/* Filter Management Styles */
.filter-management {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.filter-actions {
    display: flex;
    gap: 4px;
}

.filter-select-container {
    display: flex;
    gap: 4px;
    flex-grow: 1;
}

.filter-select {
    flex-grow: 1;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Ensure dialogs are centered and look consistent */
.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 300px;
}

.dialog h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
}

.dialog p {
    margin: 0 0 15px 0;
}

.dialog input[type="text"],
.dialog textarea {
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.dialog textarea {
    height: 60px;
    resize: vertical;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.btn {
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn:hover {
    background-color: #0056b3;
}

/* Override default btn styles for danger button */
.btn.btn-danger {
    background-color: #dc3545 !important;  /* Use !important to override default btn style */
    color: white;
}

.btn.btn-danger:hover {
    background-color: #c82333 !important;  /* Use !important to override default btn hover */
}
