/**
 * Character Creation Styling
 * Styles for witness identity forms and photo sections
 */

/* Content Layout */
.content {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  padding: 0 2rem 2rem 2rem;
  position: relative;
  z-index: 1;
}

/* Photo Section */
.photo-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.photos-container {
  border: 2px solid #8E7F7F;
  background: #D4C8BE;
  padding: 20px;
}

.photo-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.photo-nav-button {
  width: 40px;
  height: 40px;
  background: rgba(58,50,56,0.8);
  color: #EBE6D8;
  border: 1px solid #8E7F7F;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.photo-nav-button:hover {
  background: rgba(58,50,56,0.9);
}

.photo-display {
  width: 200px;
  height: 250px;
  position: relative;
}

.photo-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.photo-item.active {
  display: block;
}

.photo-frame {
  width: 100%;
  height: 200px;
  position: relative;
  background: #EBE6D8;
  border: 1px solid #5F5449;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo {
  text-align: center;
  color: #5F5449;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

.security-clearance {
  position: absolute;
  top: 5px;
  right: 5px;
  background: darkred;
  color: #EBE6D8;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: bold;
}

.photo-caption {
  text-align: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #5F5449;
  font-weight: bold;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Sections */
.section {
  border: 1px solid #8E7F7F;
  background: rgba(235,230,216,0.8);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.section h2 {
  color: #3A3238;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #8E7F7F;
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.security-level {
  background: darkred;
  color: #EBE6D8;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 2px;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem 1rem;
  align-items: center;
}

.label {
  font-weight: bold;
  color: #5F5449;
  font-size: 0.9rem;
}

.value {
  color: #3A3238;
  font-size: 0.9rem;
}

/* Form Elements */
.vintage-input, .vintage-select {
  background: #EBE6D8;
  border: 2px solid #8E7F7F;
  padding: 0.5rem;
  font-family: 'Courier New', Courier, monospace;
  color: #3A3238;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.vintage-input:focus, .vintage-select:focus {
  outline: none;
  border-color: #5F5449;
  background: #F5F0E8;
}

.vintage-button {
  background: #D4C8BE;
  border: 2px solid #8E7F7F;
  padding: 0.5rem 1rem;
  font-family: 'Courier New', Courier, monospace;
  color: #3A3238;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.vintage-button:hover {
  background: #C4B8AE;
  border-color: #5F5449;
}

.vintage-button:active {
  background: #B4A89E;
}

/* Name Input Section */
.name-input-section {
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: bold;
  color: #5F5449;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* Name History */
.name-history {
  padding: 1rem 2rem;
  background: rgba(212,200,190,0.3);
  border-left: 4px solid #8E7F7F;
  margin: 0 2rem 1rem 2rem;
}

/* Parameter Grid (for attributes) */
.parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

/* Single horizontal row used for the S.E.K.S attribute strip. Each card
 * leads with a stamped first letter (Special Elite, larger, ink-toned)
 * followed by the rest of the word in regular case, so the four cards
 * read S · E · K · S across the page. */
.parameter-grid.seks-row {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.parameter-card {
  background: rgba(212,200,190,0.3);
  border: 1px solid #8E7F7F;
  padding: 1rem;
  border-radius: 4px;
}

.parameter-name {
  font-weight: bold;
  color: #3A3238;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-size: 0.9rem;
}

/* First letter — slightly larger than the tail, ink colour (not red) so
 * the row whispers SEKS rather than shouting it. */
.seks-letter {
  font-family: 'Special Elite', 'Courier Prime', 'Courier New', cursive;
  font-size: 1.15rem;
  color: #3A3238;
  letter-spacing: 0;
  margin-right: 1px;
  display: inline-block;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.seks-rest {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: #5F5449;
  letter-spacing: 1.5px;
  font-weight: bold;
  vertical-align: 2px;
}

/* Drop per-card progress bars on the SEKS row — the strip below does it. */
.parameter-grid.seks-row .parameter-progress { display: none; }
.parameter-grid.seks-row .parameter-card {
  padding: 0.7rem 0.8rem;
  text-align: center;
}
.parameter-grid.seks-row .parameter-name {
  margin-bottom: 0.3rem;
  text-align: center;
}
.parameter-grid.seks-row .parameter-value {
  font-size: 1.45rem;
  margin-bottom: 0.3rem;
}
.parameter-grid.seks-row .parameter-controls {
  justify-content: center;
  margin-bottom: 0;
}

/* ── Unified distribution strip ────────────────────────────────── */
.seks-distribution-block {
  margin: 1.2rem 0 0.5rem 0;
}
.seks-distribution-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.68rem;
  color: #5F5449;
  letter-spacing: 2.5px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.seks-distribution-tally {
  color: #3A3238;
  letter-spacing: 1.5px;
}
.seks-distribution {
  display: flex;
  height: 16px;
  border: 1px solid #8E7F7F;
  background: rgba(142, 127, 127, 0.18);
  overflow: hidden;
}
.seks-seg {
  height: 100%;
  transition: width 0.35s ease;
  position: relative;
}
.seks-seg.strength  { background: #8B0000; }   /* ink red — muscle */
.seks-seg.endurance { background: #6b6040; }   /* olive — stamina */
.seks-seg.knowledge { background: #c4a87a; }   /* gold  — mind */
.seks-seg.seduce    { background: #8b3a5a; }   /* rose  — charm */
.seks-distribution-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  color: #5F5449;
  letter-spacing: 1.5px;
  font-weight: bold;
}
.seks-distribution-legend i.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border: 1px solid #8E7F7F;
  margin-right: 4px;
  vertical-align: -1px;
}
.seks-distribution-legend i.dot.strength  { background: #8B0000; }
.seks-distribution-legend i.dot.endurance { background: #6b6040; }
.seks-distribution-legend i.dot.knowledge { background: #c4a87a; }
.seks-distribution-legend i.dot.seduce    { background: #8b3a5a; }

.parameter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.parameter-button {
  width: 30px;
  height: 30px;
  background: #D4C8BE;
  border: 1px solid #8E7F7F;
  color: #3A3238;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.parameter-button:hover:not(:disabled) {
  background: #C4B8AE;
}

.parameter-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.parameter-value {
  min-width: 40px;
  text-align: center;
  font-weight: bold;
  color: #3A3238;
}

.parameter-progress {
  height: 8px;
  background: rgba(142,127,127,0.3);
  border-radius: 4px;
  overflow: hidden;
}

.parameter-fill {
  height: 100%;
  background: #4a7c59;
  transition: width 0.3s ease;
}

.points-remaining {
  text-align: center;
  font-weight: bold;
  color: #3A3238;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.points-remaining.warning {
  color: darkred;
}

/* Calendar Popup Styling */
.calendar-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: #EBE6D8;
  border: 2px solid #8E7F7F;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  min-width: 280px;
  font-family: 'Courier New', Courier, monospace;
  margin-top: 4px;
}

/* Position calendar properly within grid */
.info-grid .value {
  position: relative;
}

.calendar-header {
  background: #D4C8BE;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #8E7F7F;
}

.calendar-nav {
  background: #8E7F7F;
  color: #EBE6D8;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
}

.calendar-nav:hover {
  background: #5F5449;
}

#calendarTitle {
  font-weight: bold;
  color: #3A3238;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

#calendarTitle:hover {
  color: #5F5449;
}

.calendar-wrapper {
  background: #8E7F7F;
  padding: 1px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.calendar-day-header {
  background: #D4C8BE;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.8rem;
  color: #3A3238;
}

.calendar-day {
  background: #EBE6D8;
  padding: 0.5rem 0.25rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: #3A3238;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover {
  background: #D4C8BE;
}

.calendar-day.selected {
  background: #8E7F7F;
  color: #EBE6D8;
  font-weight: bold;
}

.calendar-day.empty {
  background: #F5F0E8;
  cursor: default;
}

.calendar-day.empty:hover {
  background: #F5F0E8;
}

.calendar-footer {
  background: #D4C8BE;
  padding: 0.5rem;
  text-align: center;
  border-top: 1px solid #8E7F7F;
}

/* Year Selector Styling */
.year-selector {
  background: #EBE6D8;
  border-top: 1px solid #8E7F7F;
  border-bottom: 1px solid #8E7F7F;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.year-item {
  background: #D4C8BE;
  border: 1px solid #8E7F7F;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #3A3238;
  transition: background-color 0.2s ease;
}

.year-item:hover {
  background: #C4B8AE;
}

.year-item.selected {
  background: #8E7F7F;
  color: #EBE6D8;
  font-weight: bold;
}

/* Hide year selector by default */
.year-selector.hidden {
  display: none;
}

/* Typewriter Effect */
.typing-cursor {
  display: inline-block;
  background-color: #5F5449;
  color: #5F5449;
  animation: blink 1s infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ── ASSESSOR'S NOTES (attribute hints, in-file) ──────────────
   A typed annotation block under the distribution strip: dashed
   file border, small typewriter lines, red key letters. Replaces
   the native browser tooltips, which broke the paper. */
.seks-notes {
  margin-top: 1.1rem;
  border: 1px dashed #8E7F7F;
  background: rgba(212, 200, 190, 0.22);
  padding: 0.7rem 0.9rem 0.75rem;
  font-family: 'Courier New', Courier, monospace;
}
.seks-notes-head {
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 2.5px;
  color: #8B0000;
  margin-bottom: 0.55rem;
}
.seks-notes-head .seks-notes-sub {
  color: #8E7F7F;
  font-weight: normal;
  font-style: italic;
  letter-spacing: 1px;
  text-transform: none;
}
.seks-notes-row {
  display: flex;
  gap: 0.8rem;
  padding: 0.22rem 0;
  border-bottom: 1px dotted rgba(142, 127, 127, 0.35);
  font-size: 0.8rem;
  line-height: 1.45;
}
.seks-notes-row:last-child { border-bottom: none; }
.seks-notes-key {
  flex: 0 0 9.5em;
  color: #5F5449;
  font-weight: bold;
  letter-spacing: 1px;
}
.seks-notes-key b { color: #8B0000; }
.seks-notes-txt { color: #5F5449; }
