/*
Script Name - downtime.css
Author - Richard

Purpose -
Provides styling and layout for the AIT Downtime Form UI

Responsibilities -
- Controls page layout, typography, and visual theme
- Styles form sections, inputs, buttons, and dynamic elements
- Ensures responsive design for desktop and mobile devices

Accompanying files
- HTML file - downtime.html
- JS file - downtime.js
- GSheet - "AIT DOWNTIMES"
  -- AIT-Downtimes-Google-Backend.gs
  -- AIT-Downtimes-Google-Proxy-Handler.gs
  -- getInfluenceActions.gs
  -- updateDowntimeCharacterDropdown.gs
  -- getDowntimeDefenseStatus.gs
  -- updateDowntimesView.gs
*/

/* ================= BASE PAGE STYLING ================= */
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: #F2E1A5;
  color: #2b2114;
  line-height: 1.45;
}

/* Outer page padding */
.page-shell {
  padding: 24px;
}

/* Main form container */
.form-card {
  max-width: 1000px;
  margin: 0 auto;
  background: #f7ebc3;
  border: 2px solid #3a5f3a;
  border-radius: 10px;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(43, 33, 20, 0.12);
}

/* ================= TYPOGRAPHY ================= */
h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: #21351f;
}

.intro-text {
  margin-bottom: 24px;
}

/* ================= SECTION LAYOUT ================= */
.form-section {
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid #3a5f3a;
  background: #fbf3d7;
  border-radius: 8px;
}

.section-note {
  margin-top: 0;
  margin-bottom: 16px;
}

.section-note p {
  margin: 0 0 10px 0;
}

.section-note ul {
  margin: 0;
  padding-left: 22px;
}

.section-note li {
  margin-bottom: 6px;
}

/* Two-column layout for player info */
.player-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  row-gap: 18px;
}

.player-grid > div {
  display: flex;
  flex-direction: column;
}

/* Preserves grid spacing where an empty cell is used intentionally */
.player-grid > div:empty {
  visibility: hidden;
}

/* ================= FORM CONTROLS ================= */
label {
  display: block;
  margin: 12px 0 6px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #3a5f3a;
  border-radius: 6px;
  background: #fffdf4;
  color: #2b2114;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

/* Shared focus state for accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid #577d57;
  outline-offset: 2px;
}

/* Checkbox label rows */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-weight: normal;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  transform: translateY(1px);
}

/* Nested optional blocks that appear under toggles */
.nested-block {
  margin: 8px 0 18px 24px;
  padding: 12px;
  border-left: 4px solid #3a5f3a;
  background: #fdf8e8;
  border-radius: 4px;
}

/* Dynamic influence action card */
.influence-block {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #3a5f3a;
  border-radius: 8px;
  background: #fdf8e8;
}

/* Formats notes in JS after a label */
.field-note {
  font-style: italic;
  font-weight: normal;
  margin-bottom: 4px;
}

/* XP rows are cost + purchase side by side */
.xp-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ================= BUTTONS ================= */
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

button {
  background: #3a5f3a;
  color: #fffdf4;
  border: none;
  border-radius: 6px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: bold;
  font: inherit;
}

button:hover {
  filter: brightness(0.95);
}

button:active {
  transform: translateY(1px);
}

.reset-button {
  background: #b22222;
}

.submit-button {
  background: #1f5fa8;
}

/* ================= LINKS / REVIEW CONTENT ================= */
a {
  color: #244d24;
}

#reviewContent p {
  margin: 8px 0;
  white-space: pre-line;
}

/* ================= MOBILE / SMALL SCREEN LAYOUT ================= */
@media (max-width: 700px) {
  .page-shell {
    padding: 12px;
  }

  .form-card {
    padding: 16px;
  }

  .player-grid {
    grid-template-columns: 1fr;
  }

  .xp-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}


/* Influence contact checkbox line and short contact field */
.influence-contact-row {
  margin: 12px 0 6px;
  align-items: flex-start;
}

.influence-contact-row span {
  display: inline-block;
  line-height: 1.4;
}

.influence-contact-wrap {
  margin-top: 4px;
}

.contact-name-input {
  max-width: 320px;
}

.contact-doc-ref {
  color: #1a3dc1;
}
