/* VOI Parameter Table Styling */
.voi-param-table {
  display: grid;
  grid-template-columns: 150px 80px 80px 80px;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: fit-content;
}

.voi-table-header {
  text-align: center;
  font-weight: 600;
  color: #555;
}

.voi-table-row-label {
  font-weight: 500;
  color: #333;
  font-size: 0.85em;
  text-align: right;
  padding-right: 0.5rem;
}

.voi-table-input {
  width: 100%;
  padding: 0.25rem;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #fff;
  font-family: monospace;
}

.voi-table-input-readonly {
  background-color: #f5f5f5;
  color: #666;
}

/* Responsive image row for slice viewers */
.case-detail-wrapper {
  width: 100%;
}
.image-row {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  width: 100%;
}
.image-container {
  flex: 1 1 0;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.webgl-container {
  width: 100%;
  min-width: 80px;
  min-height: 80px;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 8px;
  display: block;
}
.x-slider, .y-slider, .z-slider {
  margin-top: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Axis labels overlay on WebGL containers */
.axis-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.axis-label-x {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-crosshair-x);
  font-weight: bold;
  font-size: 10px;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.axis-label-y {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-crosshair-y);
  font-weight: bold;
  font-size: 10px;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.axis-label-y.top {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label-z {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-crosshair-z);
  font-weight: bold;
  font-size: 10px;
  font-family: monospace;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Coordinate labels for slice positions */
#x-coord, #y-coord, #z-coord {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  font-family: monospace;
}

/* Shared CSS Variables and Common Styles */
:root {
  --accent: #136f8f;
  --muted: #6b7280;
  --card: #ffffff;
  --bg: #f6f9fb;
  --max-width: 1000px;
  
  /* Visualization colors for VOI, crosshairs, and axis labels */
  --color-voi: rgba(255, 0, 255, 1.0);
  --color-crosshair-x: rgba(255, 255, 0, 0.7);
  --color-crosshair-y: rgba(255, 255, 255, 0.7);
  --color-crosshair-z: rgba(200, 0, 0, 0.7);
}

/* Force consistent blue color for form controls across browsers */
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
  accent-color: #136f8f;
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Page-specific styles */
html, body {
  height: 100%;
}

body {
  background: var(--bg);
  margin: 0;
  padding: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: var(--max-width);
}

header {
  margin-bottom: 1.5rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

h1 {
  margin: 0;
  color: #0f172a;
}

p.lead {
  color: var(--muted);
  margin: 0;
}

.card-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.card {
  flex: 1;
  min-width: 200px;
  background: var(--card);
  padding: 1.25rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform .15s ease, box-shadow .15s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: bold;
}

.card p {
  margin: .5rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  text-align: left;
}

.info {
  margin-top: 1.5rem;
}

.info-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

.info-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.info-text {
  flex: 1;
  min-width: 0;
}

.info-text h3 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.2rem;
}

.info-text p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.info-text p:last-child {
  margin-bottom: 0;
}

/* Auth Status */
.auth-status {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  text-align: right;
}

.auth-status a {
  color: var(--accent);
  text-decoration: none;
}

.auth-status a:hover {
  text-decoration: underline;
}

/* Forms */
.form-container {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--card);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 111, 143, 0.1);
}

.btn {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn:hover {
  background: #0f5870;
}

.btn:disabled {
  background: #9ca3af;
  color: #d1d5db;
  cursor: not-allowed;
}

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
}

.error {
  color: #dc2626;
  background: #fee2e2;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.success {
  color: #059669;
  background: #d1fae5;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

table th {
  background: var(--accent);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover {
  background: #f9fafb;
}

.action-links {
  margin: 1.5rem 0;
}

.action-links a {
  color: var(--accent);
  text-decoration: none;
  margin-right: 1rem;
}

.action-links a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card-row {
    flex-direction: column;
  }
  
  .card {
    min-width: 100%;
  }
  
  .form-container {
    margin: 1rem;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  table th, table td {
    padding: 0.75rem;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .auth-status {
    text-align: left;
  }
}
