/* NEIRA Web Components UI - Minimal CSS */

/* Base styles with system fonts */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

body {
  background-color: #f1f1f1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-weight: 400;
}

h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }

/* p {
  margin-top: 0;
  margin-bottom: 1em;
} */

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

a:hover {
  text-decoration: underline;
}

/* Layout utilities */
.section {
  margin-top: 16px;
  margin-bottom: 16px;
}

.columns {
  display: flex
}

#corrections-container {
  margin-left: 20px;
}

.content-width {
  max-width: 900px;
}

.heat {
  margin-bottom: 4px;
  padding: 16px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid #ccc;
  margin: 24px 0;
}

/* Component-specific styles */
page-layout {
  display: block;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Race results styling */
.race-results {
  margin-bottom: 4px;
  padding: 16px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.race-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.results-table {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  background-color: white; /* #f8f8f8; */
  padding: 0;
  border-radius: 4px;
  overflow-x: auto;
}

.result-row {
  color: #333;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}

.result-row:hover {
  background-color: #e8e8e8;
  text-decoration: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #ddd;
  margin-top: 16px;
}

.tab-button {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.2s;
}

.tab-button:hover {
  color: #333;
  background-color: #f8f8f8;
}

.tab-button.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
  font-weight: 500;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Comparison table styles */
.comparison-table {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background-color: #fff;
}

.table-header {
  display: flex;
  background-color: #f8f8f8;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
}

.table-row {
  display: flex;
  border-bottom: 1px solid #eee;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background-color: #fafafa;
}

.table-cell {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-cell {
  font-weight: 600;
  color: #333;
  align-items: center;
}

/* First column (Heat name) - fixed width */
.table-header .header-cell:nth-child(1) {
  flex: 0 0 150px;
  border-right: 1px solid #eee;
}

/* Data columns - equal width */
.table-header .header-cell:nth-child(2),
.table-header .header-cell:nth-child(3),
.table-header .header-cell:nth-child(4) {
  flex: 1;
  border-right: 1px solid #eee;
  min-width: 0;
}

.table-header .header-cell:last-child {
  border-right: none;
}

.heat-name-cell {
  flex: 0 0 150px;
  font-weight: 500;
  border-right: 1px solid #eee;
  justify-content: center;
}

.heat-data-cell {
  flex: 1;
  border-right: 1px solid #eee;
  min-width: 0;
}

.heat-data-cell:last-child {
  border-right: none;
}

.heat-data-cell .results-table {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: transparent;
  white-space: pre;
}

.heat-data-cell .result-row {
  display: block;
  width: 100%;
}

/* Corrections UI */
.correction-item {
  margin-bottom: 12px;
  padding: 12px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.correction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.correction-type {
  font-weight: 600;
  color: #0066cc;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 14px;
}

.correction-actions {
  display: flex;
  gap: 8px;
}

.correction-details {
  color: #333;
}

.correction-details p {
  margin: 4px 0;
}

.correction-details ul {
  margin: 4px 0;
  padding-left: 20px;
}

.correction-comment {
  font-style: italic;
  color: #666;
}

.warning-text {
  color: #d9534f;
  font-weight: 500;
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-primary {
  padding: 10px 16px;
  background-color: #0066cc;
  color: white;
  font-weight: 500;
  margin-top: 12px;
}

.btn-primary:hover {
  background-color: #0052a3;
}

.btn-small {
  padding: 4px 12px;
  background-color: #f8f8f8;
  color: #333;
  border: 1px solid #ddd;
}

.btn-small:hover {
  background-color: #e8e8e8;
}

.btn-danger {
  color: #d9534f;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.form-group textarea {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

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