/* 
 * Forms Page Styles - Rosewood Ridge Site
 * Web 3.0 Design System
 */

@import url('variables.css');

/* Forms Page Layout */
.page-content-wrapper {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 15px;
}

/* Master form type selector section */
.form-section {
  background: var(--gradient-dark);
  padding: 20px 25px;
  border-radius: var(--border-radius-std);
  margin-bottom: 2rem;
  border: 1px solid var(--accent-color);
  box-shadow: var(--box-shadow-std);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.form-section div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.form-section label {
  font-weight: 500;
  color: var(--text-secondary-color);
  margin-bottom: 0;
}

#masterFormType {
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
  min-width: 250px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#masterFormType:focus {
  outline: 0;
  border-color: var(--highlight-color);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), var(--box-shadow-glow);
}

h1, h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

h2 {
  margin-bottom: 2rem;
  font-weight: 600;
  border-bottom: 1px solid var(--accent-color);
  padding-bottom: 0.8rem;
  margin-top: 0;
}

/* Form container */
.form-container {
  background: var(--gradient-dark);
  padding: 30px;
  border-radius: var(--border-radius-std);
  margin-top: 20px;
  border: 1px solid var(--accent-color);
  box-shadow: var(--box-shadow-std);
  overflow: visible;
}

/* Form layout */
.form-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
  overflow: visible;
}

.form-inputs {
  flex: 3;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: visible;
}

.form-output {
  flex: 2;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 5;
  background: rgba(10, 10, 10, 0.5);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius-std);
  padding: 15px;
}

/* Output Textarea */
.form-output textarea {
  width: 100%;
  height: 500px;
  resize: vertical;
  flex-grow: 1;
  background-color: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  order: 2;
  border-radius: 4px;
  padding: 0.8rem;
  font-family: monospace;
  font-size: 0.9rem;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.form-output textarea:focus {
  outline: 0;
  border-color: var(--highlight-color);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), var(--box-shadow-glow);
}

/* Buttons */
.form-output button,
.form-inputs button {
  display: block;
  width: auto;
  max-width: 200px;
  margin: 15px auto 0 auto;
  padding: 10px 25px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(145deg, #2aaa45, #1f7733);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-std);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.form-output button {
  order: 1;
}

.form-output button:hover,
.form-inputs button:hover {
  background: linear-gradient(145deg, #3bbb55, #2f8743);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.form-output button:active,
.form-inputs button:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Input Fields Styling */
.form-inputs label {
  margin-bottom: 3px;
  display: block;
  color: var(--text-secondary-color);
  font-size: 0.9em;
  font-weight: 500;
}

.form-inputs input,
.form-inputs select,
.form-inputs textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 5px;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-inputs input:focus,
.form-inputs select:focus,
.form-inputs textarea:focus {
  outline: 0;
  border-color: var(--highlight-color);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), var(--box-shadow-glow);
}

.form-inputs input[readonly] {
  background-color: rgba(40, 40, 40, 0.7);
  cursor: not-allowed;
}

.form-inputs textarea {
  min-height: 100px;
  resize: vertical;
}

/* Fieldset Styling */
.form-inputs fieldset {
  border: 1px solid var(--accent-color);
  padding: 15px;
  border-radius: var(--border-radius-std);
  background: rgba(0,0,0,0.1);
}

.form-inputs fieldset legend {
  padding: 0 10px;
  color: var(--highlight-color);
  font-weight: 600;
  font-size: 1em;
  margin-bottom: 10px;
  width: 100%;
}

/* Charges Table Styling */
.charges-table-container {
  margin-bottom: 1.5rem;
  overflow: visible;
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.1);
  border-radius: var(--border-radius-std);
  padding: 5px;
  border: 1px solid var(--accent-color);
}

#warrantChargesTable, 
#arrestChargesTable, 
#medicalInjuriesTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1rem;
  display: table !important;
  table-layout: fixed;
  word-wrap: break-word;
  border-radius: var(--border-radius-std);
  overflow: hidden;
}

#warrantChargesTable thead, 
#arrestChargesTable thead, 
#medicalInjuriesTable thead {
  display: table-header-group !important;
  background: var(--gradient-accent);
  color: var(--text-color);
}

#warrantChargesTable th, 
#arrestChargesTable th, 
#medicalInjuriesTable th {
  padding: 0.8rem 0.6rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--accent-color);
}

#warrantChargesTable tbody, 
#arrestChargesTable tbody, 
#medicalInjuriesTable tbody {
  display: table-row-group !important;
  background-color: rgba(255, 255, 255, 0.03);
}

#warrantChargesTable tr, 
#arrestChargesTable tr, 
#medicalInjuriesTable tr {
  display: table-row !important;
  background-color: transparent;
  transition: background-color 0.2s ease;
}

#warrantChargesTable tbody tr:nth-child(2n),
#arrestChargesTable tbody tr:nth-child(2n),
#medicalInjuriesTable tbody tr:nth-child(2n) {
  background-color: rgba(255, 255, 255, 0.05);
}

#warrantChargesTable tbody tr:hover,
#arrestChargesTable tbody tr:hover,
#medicalInjuriesTable tbody tr:hover {
  background-color: rgba(125, 56, 45, 0.1);
}

#warrantChargesTable td, 
#arrestChargesTable td, 
#medicalInjuriesTable td {
  border: none;
  border-bottom: 1px solid var(--accent-color);
  padding: 0.6rem;
  vertical-align: middle !important;
  white-space: normal;
}

#warrantChargesTable tr:last-child td,
#arrestChargesTable tr:last-child td,
#medicalInjuriesTable tr:last-child td {
  border-bottom: none;
}

/* Alignment styles */
#warrantChargesTable td:last-child, 
#arrestChargesTable td:last-child, 
#medicalInjuriesTable td:last-child,
#warrantChargesTable th:last-child, 
#arrestChargesTable th:last-child, 
#medicalInjuriesTable th:last-child {
  white-space: nowrap;
  text-align: center;
}

#warrantChargesTable td:nth-child(3),
#arrestChargesTable td:nth-child(3),
#warrantChargesTable th:nth-child(3),
#arrestChargesTable th:nth-child(3) {
  text-align: center;
}

/* Controls within table cells */
.charge-row button, 
.charge-row input, 
.charge-row select,
.injury-row button, 
.injury-row input, 
.injury-row select {
  display: inline-block !important;
  width: auto !important;
  margin-right: 4px;
  margin-bottom: 0 !important;
  vertical-align: middle !important;
  box-sizing: border-box;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.charge-row input:focus, 
.charge-row select:focus,
.injury-row input:focus, 
.injury-row select:focus {
  outline: 0;
  border-color: var(--highlight-color);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), var(--box-shadow-glow);
}

/* Select widths */
#warrantChargesTable .charge-select, 
#warrantChargesTable .modifier-select,
#arrestChargesTable .arrest-charge-select, 
#arrestChargesTable .arrest-modifier-select,
#medicalInjuriesTable .medical-body-select, 
#medicalInjuriesTable .medical-injurytype-select,
#medicalInjuriesTable .medical-specific-select, 
#medicalInjuriesTable .medical-side-select {
  width: auto !important;
  max-width: 90% !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Count input */
#arrestChargesTable .arrest-count-input,
#warrantChargesTable .count-input {
  min-width: 50px;
  width: 85% !important;
  max-width: 70px !important;
  text-align: center;
}

/* Column Widths */
#warrantChargesTable th:nth-child(1),
#warrantChargesTable td:nth-child(1),
#arrestChargesTable th:nth-child(1),
#arrestChargesTable td:nth-child(1) {
  width: 45%;
}

#warrantChargesTable th:nth-child(2),
#warrantChargesTable td:nth-child(2),
#arrestChargesTable th:nth-child(2),
#arrestChargesTable td:nth-child(2) {
  width: 25%;
}

#warrantChargesTable th:nth-child(3),
#warrantChargesTable td:nth-child(3),
#arrestChargesTable th:nth-child(3),
#arrestChargesTable td:nth-child(3) {
  width: 15%;
  text-align: center;
}

#warrantChargesTable th:nth-child(4),
#warrantChargesTable td:nth-child(4),
#arrestChargesTable th:nth-child(4),
#arrestChargesTable td:nth-child(4) {
  width: 15%;
  text-align: center;
}

/* Custom Checkbox Styles */
.custom-checkbox-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 15px;
  margin-bottom: 5px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide default checkbox */
.custom-checkbox-container input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* Custom checkbox appearance */
.checkmark {
  position: relative;
  display: inline-block;
  height: 24px;
  width: 24px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-color);
  border-radius: 5px;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  margin-right: 0;
}

.custom-checkbox-container:hover .checkmark {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: var(--highlight-color);
}

/* Style when checked */
.custom-checkbox-container input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(145deg, var(--highlight-color), #5e2a22);
  border-color: var(--highlight-color);
  box-shadow: 0 0 5px var(--highlight-color);
}

/* Checkmark symbol */
.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid #1a1a1a;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Show checkmark when checked */
.custom-checkbox-container input[type="checkbox"]:checked + .checkmark::after {
  display: block;
}

/* Label text style within the container */
.custom-checkbox-container .checkbox-label-text {
  font-size: 0.95rem;
  color: var(--text-color);
  padding-left: 8px;
}

/* Tooltip styles */
.tooltip-trigger {
  color: var(--highlight-color);
  font-weight: 600;
  cursor: help;
  position: relative;
  border-bottom: 1px dotted var(--highlight-color);
}

.tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid var(--accent-color);
  box-shadow: var(--box-shadow-std);
  font-size: 0.85rem;
  line-height: 1.4;
  width: max-content;
  max-width: 300px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  text-align: left;
  font-weight: normal;
  border-bottom: none;
}

.tooltip-trigger:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Calculated Totals Box */
.calculated-totals-box {
  background: var(--gradient-dark);
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius-std);
  padding: 15px 20px;
  margin-top: 15px;
  box-shadow: var(--box-shadow-std);
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.total-item {
  text-align: center;
}

.total-label {
  display: block;
  font-size: 0.9em;
  color: var(--text-secondary-color);
  margin-bottom: 3px;
}

.total-value {
  font-size: 1.2em;
  font-weight: 600;
  color: #ff6b6b !important;
}

/* Specific styling for HUT value */
.total-value.hut {
  color: #ff6b6b !important;
  font-style: italic;
}

/* Attempted Murder Disclaimer Box Styling */
#arrestAttemptedMurderDisclaimerContainer {
  background: linear-gradient(145deg, rgba(60, 30, 30, 0.8), rgba(40, 15, 15, 0.9));
  border: 1px solid #ff4d4d;
  border-radius: var(--border-radius-std);
  padding: 15px 20px;
  margin-top: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
  display: block;
}

.disclaimer-title {
  font-weight: 600;
  color: #ffcccc;
  margin-bottom: 10px;
  font-size: 1.05em;
  text-align: center;
  border-bottom: 1px solid rgba(255, 100, 100, 0.5);
  padding-bottom: 8px;
}

.disclaimer-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Ensure checkbox container aligns */
#arrestAttemptedMurderDisclaimerContainer .custom-checkbox-container {
  margin-top: 2px;
  flex-shrink: 0;
}

.disclaimer-text {
  font-size: 0.9em;
  color: var(--text-secondary-color);
  line-height: 1.5;
  flex-grow: 1;
}

/* Ensure tooltip trigger styles apply within disclaimer */
#arrestAttemptedMurderDisclaimerContainer .tooltip-trigger {
  color: #ff8080;
  border-bottom: 1px dotted #ff8080;
}

/* Wait/Error Messages - Hide by default */
.wait-message {
  color: var(--warning-color);
  margin-top: 10px;
  font-weight: 500;
  text-align: center;
  background-color: rgba(150, 120, 0, 0.15);
  border: 1px solid rgba(200, 160, 0, 0.4);
  padding: 0.7rem;
  border-radius: var(--border-radius-std);
  display: none;
}

/* Medical Table Specific Column Widths */
#medicalInjuriesTable th:nth-child(1),
#medicalInjuriesTable td:nth-child(1) {
  width: 20%;
}

#medicalInjuriesTable th:nth-child(2),
#medicalInjuriesTable td:nth-child(2) {
  width: 20%;
}

#medicalInjuriesTable th:nth-child(3),
#medicalInjuriesTable td:nth-child(3) {
  width: 25%;
}

#medicalInjuriesTable th:nth-child(4),
#medicalInjuriesTable td:nth-child(4) {
  width: 20%;
}

#medicalInjuriesTable th:nth-child(5),
#medicalInjuriesTable td:nth-child(5) {
  width: 10%;
  text-align: center;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .form-layout {
    flex-direction: column;
  }
  
  .form-inputs, .form-output {
    min-width: 100%;
    flex: 1;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  
  .form-output button {
    order: 1;
  }
  
  .form-output textarea {
    order: 2;
    height: 300px;
  }
}