
/* Default (Desert) Theme Variables */
:root {
  --background-color: #f4e9d8;
  --text-color: #4a3a29;
  --sandy-red: #e9967a;
  --sky-blue: #87ceeb;
  --border-color: #8b4513;
  --button-bg-color: #e3c29b;
  --textarea-bg-color: #fbf5e6;
  --form-bg-color: #f9f0dc;
  --light-cream: #fffaf0;
  --placeholder-color: #bbb;
}

/* Earthy Theme Variables */
.earthy-theme {
  --background-color: #e5e5dc;
  --text-color: #3b2f2f;
  --sandy-red: #b5651d;
  --sky-blue: #7ec0ee;
  --border-color: #7b6d5f;
  --button-bg-color: #cdb79e;
  --textarea-bg-color: #f5f5dc;
  --form-bg-color: #e0d8c3;
  --light-cream: #faf0e6;
}

/* Ocean Theme Variables */
.ocean-theme {
  --background-color: #e0f7fa;
  --text-color: #01579b;
  --sandy-red: #0288d1;
  --sky-blue: #4fc3f7;
  --border-color: #0277bd;
  --button-bg-color: #b3e5fc;
  --textarea-bg-color: #e1f5fe;
  --form-bg-color: #b2ebf2;
  --light-cream: #e0f2f1;
}

/* General Styles */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.red {
  background: var(--sandy-red);
}

.blue {
  background: var(--sky-blue);
}

.hide {
  display: none !important;
}

hr.pageborder {
  border-top: 5px solid var(--border-color);
}

button, #buttonload {
  text-align: center;
  border: 1px solid var(--border-color);
  font-size: 10px;
  border-radius: 10px;
  padding: 4px 6px;
  font-weight: bold;
  background-color: var(--button-bg-color);
}

textarea {
  font-size: 12px;
  text-align: left;
  width: calc(100% - 20px - 2px);
  border-radius: 10px;
  padding: 10px;
  resize: none;
  overflow: hidden;
  height: 15em;
  background-color: var(--textarea-bg-color);
  border: 1px solid var(--border-color);
}

input[type="checkbox"] {
  cursor: pointer;
}

div.box {
  margin-top: 10px;
}

form.charsheet {
  width: 800px;
  margin: 10px auto;
  background-color: var(--form-bg-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

form.charsheet div.textblock {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  align-items: center;
}

form.charsheet div.textblock label {
  text-align: center;
  border: 1px solid var(--border-color);
  border-top: 0;
  font-size: 10px;
  width: calc(100% - 20px - 2px);
  border-radius: 0 0 10px 10px;
  padding: 4px 0;
  font-weight: bold;
  background-color: var(--button-bg-color);
}

form.charsheet div.textblock textarea {
  border: 1px solid var(--border-color);
  background-color: var(--textarea-bg-color);
}

form.charsheet ul {
  margin: 0;
  padding: 0;
}

form.charsheet ul li {
  list-style-image: none;
  display: block;
}

form.charsheet ::placeholder {
  color: var(--placeholder-color);
}

form.charsheet label {
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-color);
}

form.charsheet header {
  display: flex;
  align-content: stretch;
  align-items: stretch;
}

form.charsheet header section.charname {
  border: 1px solid var(--border-color);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  padding: 5px 0;
  background-color: var(--button-bg-color);
  width: 30%;
  display: flex;
  flex-direction: column-reverse;
  margin: auto;
}

form.charsheet header section.charname input {
  padding: 0.5em;
  margin: 5px;
  border: 0;
}

form.charsheet header section.charname label {
  padding-left: 1em;
}

form.charsheet header section.misc {
  width: 70%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1em;
}

#misc-desc {
  width: 100%;
}

form.charsheet header section.misc ul {
  padding: 10px 0px 5px 0px;
  display: flex;
  flex-wrap: wrap;
}

form.charsheet header section.misc ul li {
  width: 33.33333%;
  display: flex;
  flex-direction: column-reverse;
}

#misc-desc ul li {
  width: 25%;
}

form.charsheet header section.misc ul li label {
  margin-bottom: 5px;
}

form.charsheet header section.misc ul li input {
  border: 0;
  border-bottom: 1px solid #ddd;
}

form.charsheet main {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

form.charsheet main div.label-container {
  position: relative;
  width: 100%;
  height: 18px;
  margin-top: 6px;
  border: 1px solid var(--border-color);
  border-left: 0;
  text-align: center;
}

form.charsheet main div.label-container > label {
  position: absolute;
  left: 0;
  top: 1px;
  transform: translate(0%, 50%);
  width: 100%;
  font-size: 8px;
  color: var(--text-color);
}

form.charsheet main > section {
  width: 32%;
  display: flex;
  flex-direction: column;
}

form.charsheet main > section section.attributes {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

form.charsheet main > section section.attributes div.scores {
  width: 101px;
  background-color: var(--form-bg-color);
  border-radius: 10px;
  padding-bottom: 5px;
}

form.charsheet main > section section.attributes div.scores label {
  font-size: 8px;
  font-weight: bold;
  color: var(--text-color);
}

form.charsheet main > section section.attributes div.scores ul {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

form.charsheet main > section section.attributes div.scores ul li {
  height: 80px;
  width: 70px;
  background-color: var(--light-cream);
  border: 1px solid var(--border-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

form.charsheet main > section section.attributes div.scores ul li input {
  width: 100%;
  padding: 0;
  border: 0;
}

form.charsheet main > section section.attributes div.scores ul li div.score input {
  text-align: center;
  font-size: 40px;
  padding: 2px 0px 0px 0px;
  background: var(--light-cream);
}

form.charsheet main > section section.attributes div.scores ul li div.modifier {
  margin-top: 3px;
}

form.charsheet main > section section.attributes div.scores ul li div.modifier input {
  background: var(--light-cream);
  width: 30px;
  height: 20px;
  border: 1px inset var(--border-color);
  border-radius: 20px;
  margin: -1px;
  text-align: center;
}

form.charsheet main > section section.attributes div.attr-applications div.inspiration, form.charsheet main > section section.attributes div.attr-applications div.proficiencybonus {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

form.charsheet main > section section.attributes div.attr-applications div.inspiration input, form.charsheet main > section section.attributes div.attr-applications div.proficiencybonus input {
  width: 30px;
  height: 28px;
  border: 1px solid var(--border-color);
  text-align: center;
  border-radius: 10px;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 5px;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section div.label {
  margin-top: 10px;
  margin-bottom: 2.5px;
  text-align: center;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: bold;
  color: var(--text-color);
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li {
  display: flex;
  align-items: center;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li > * {
  margin-left: 5px;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li label {
  text-transform: none;
  font-size: 8px;
  text-align: left;
  order: 3;
  color: var(--text-color);
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li label span.skill {
  color: var(--placeholder-color);
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li input[type="text"] {
  width: 30px;
  font-size: 12px;
  text-align: center;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  order: 2;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li input[type="checkbox"] {
  appearance: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  order: 1;
}

form.charsheet main > section section.attributes div.attr-applications div.list-section ul li input[type="checkbox"]:checked {
  background-color: var(--border-color);
}

form.charsheet main > section div.passive-perception {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

form.charsheet main > section div.passive-perception input {
  width: 30px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

form.charsheet main > section div.otherprofs textarea {
  height: 17em;
}

form.charsheet main section.combat {
  background-color: var(--form-bg-color);
  display: flex;
  flex-wrap: wrap;
  border-radius: 10px;
}

form.charsheet main section.combat > div {
  overflow: hidden;
}

form.charsheet main section.combat > div.armorclass, form.charsheet main section.combat > div.initiative, form.charsheet main section.combat > div.speed {
  flex-basis: 33.333%;
}

form.charsheet main section.combat > div.armorclass > div, form.charsheet main section.combat > div.initiative > div, form.charsheet main section.combat > div.speed > div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  margin-top: 10px;
}

form.charsheet main section.combat > div.armorclass > div label, form.charsheet main section.combat > div.initiative > div label, form.charsheet main section.combat > div.speed > div label {
  font-size: 8px;
  width: 50px;
  border: 1px solid var(--border-color);
  border-top: 0;
  background-color: var(--light-cream);
  text-align: center;
  padding: 5px 0;
  border-radius: 0 0 10px 10px;
}

form.charsheet main section.combat > div.armorclass > div input, form.charsheet main section.combat > div.initiative > div input, form.charsheet main section.combat > div.speed > div input {
  height: 70px;
  width: 70px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  text-align: center;
  font-size: 30px;
}

form.charsheet main section.combat > div.hp {
  flex-basis: 100%;
}

form.charsheet main section.combat > div.hp > div.regular {
  background-color: var(--light-cream);
  border: 1px solid var(--border-color);
  margin: 10px;
  margin-bottom: 5px;
  border-radius: 10px 10px 0 0;
}

form.charsheet main section.combat > div.hp > div.regular > div.max {
  display: flex;
  justify-content: space-around;
  align-items: baseline;
}

form.charsheet main section.combat > div.hp > div.regular > div.max label {
  font-size: 10px;
  text-transform: none;
  color: var(--placeholder-color);
}

form.charsheet main section.combat > div.hp > div.regular > div.max input {
  width: 40%;
  border: 0;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
  text-align: center;
}

form.charsheet main section.combat > div.hp > div.regular > div.current {
  display: flex;
  flex-direction: column-reverse;
}

form.charsheet main section.combat > div.hp > div.regular > div.current input {
  border: 0;
  width: 100%;
  padding: 1em 0;
  font-size: 20px;
  text-align: center;
}

form.charsheet main section.combat > div.hp > div.regular > div.current label {
  font-size: 10px;
  padding-bottom: 5px;
  text-align: center;
  font-weight: bold;
}

form.charsheet main section.combat > div.hp > div.temporary {
  margin: 10px;
  margin-top: 0;
  border: 1px solid var(--border-color);
  border-radius: 0 0 10px 10px;
  display: flex;
  flex-direction: column-reverse;
  background-color: var(--light-cream);
}

form.charsheet main section.combat > div.hp > div.temporary input {
  padding: 1em 0;
  font-size: 20px;
  border: 0;
  text-align: center;
}

form.charsheet main section.combat > div.hp > div.temporary label {
  font-size: 10px;
  padding-bottom: 5px;
  text-align: center;
  font-weight: bold;
}

form.charsheet main section.combat > div.hitdice, form.charsheet main section.combat > div.deathsaves {
  flex: 1 50%;
  height: 100px;
}

form.charsheet main section.combat > div.hitdice > div, form.charsheet main section.combat > div.deathsaves > div {
  height: 80px;
}

form.charsheet main section.combat > div.hitdice > div {
  background-color: var(--light-cream);
  margin: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

form.charsheet main section.combat > div.hitdice > div > div.total {
  display: flex;
  align-items: baseline;
  justify-content: space-around;
  padding: 5px 0;
}

form.charsheet main section.combat > div.hitdice > div > div.total label {
  font-size: 10px;
  color: var(--placeholder-color);
  margin: 0.25em;
  text-transform: none;
}

form.charsheet main section.combat > div.hitdice > div > div.total input {
  font-size: 12px;
  flex-grow: 1;
  border: 0;
  border-bottom: 1px solid #ddd;
  width: 50%;
  margin-right: 0.25em;
  padding: 0 0.25em;
  text-align: center;
}

form.charsheet main section.combat > div.hitdice > div > div.remaining {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
}

form.charsheet main section.combat > div.hitdice > div > div.remaining label {
  text-align: center;
  padding: 2px;
  font-size: 10px;
}

form.charsheet main section.combat > div.hitdice > div > div.remaining input {
  text-align: center;
  border: 0;
  flex: 1;
}

form.charsheet main section.combat > div.deathsaves > div {
  margin: 10px;
  background: var(--light-cream);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column-reverse;
}

form.charsheet main section.combat > div.deathsaves > div > div.label {
  text-align: center;
}

form.charsheet main section.combat > div.deathsaves > div > div.label label {
  font-size: 10px;
}

form.charsheet main section.combat > div.deathsaves > div > div.marks {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

form.charsheet main section.combat > div.deathsaves > div > div.marks div.deathsuccesses, form.charsheet main section.combat > div.deathsaves > div > div.marks div.deathfails {
  display: flex;
  align-items: center;
}

form.charsheet main section.combat > div.deathsaves > div > div.marks div.deathsuccesses label, form.charsheet main section.combat > div.deathsaves > div > div.marks div.deathfails label {
  font-size: 8px;
  text-align: right;
  flex: 1 50%;
}

form.charsheet main section.combat > div.deathsaves > div div.bubbles {
  flex: 1 40%;
  margin-left: 5px;
}

form.charsheet main section.combat > div.deathsaves > div div.bubbles input[type="checkbox"] {
  appearance: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

form.charsheet main section.combat > div.deathsaves > div div.bubbles input[type="checkbox"]:checked {
  background-color: var(--border-color);
}

form.charsheet header section.attacksandspellcasting {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 10px;
  width: 100%;
  background-color: var(--form-bg-color);
}

form.charsheet header section.attacksandspellcasting > div {
  margin: 10px;
  font-weight: bold;
  display: flex;
  flex-direction: column;
}

form.charsheet header section.attacksandspellcasting > div > label {
  order: 3;
  text-align: center;
  color: var(--text-color);
}

form.charsheet header section.attacksandspellcasting > div > table {
  width: 100%;
}

form.charsheet header section.attacksandspellcasting > div > table th, form.charsheet header section.attacksandspellcasting > div > table td {
  font-size: 10px;
  color: var(--text-color);
}

form.charsheet header section.attacksandspellcasting > div > table input {
  width: calc(100% - 4px);
  border: 0;
  background-color: var(--button-bg-color);
  font-size: 10px;
  padding: 3px;
}

form.charsheet header section.attacksandspellcasting > div textarea {
  border: 0;
  height: 10em;
  background-color: var(--textarea-bg-color);
}

form.charsheet header section.currency {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 10px;
  text-align: center;
  background-color: var(--form-bg-color);
}

form.charsheet header section.currency > div {
  padding: 10px;
  font-weight: bold;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

form.charsheet header section.currency > div > div.money ul {
  display: flex;
  flex-direction: column;
  height: 100%;
}

form.charsheet header section.currency > div > div.money ul > li {
  display: flex;
  align-items: center;
  padding: 3px 0;
}

form.charsheet header section.currency > div > div.money ul > li label {
  border: 1px solid var(--border-color);
  border-radius: 10px 0 0 10px;
  border-right: 0;
  width: 20px;
  font-size: 8px;
  text-align: center;
  padding: 3px 0;
  background-color: var(--light-cream);
}

form.charsheet header section.currency > div > div.money ul > li input {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 40px;
  padding: 10px 3px;
  font-size: 12px;
  text-align: center;
  background-color: var(--light-cream);
}

form.charsheet header section.currency > div > label {
  order: 3;
  text-align: center;
  flex: 100%;
  color: var(--text-color);
}

form.charsheet header section.currency > div > textarea {
  flex: 1;
  border: 0;
  height: 23em;
  background-color: var(--textarea-bg-color);
}

form.charsheet main section.flavor {
  padding: 10px;
  background: var(--form-bg-color);
  border-radius: 10px;
}

form.charsheet main section.flavor div {
  background: var(--light-cream);
  display: flex;
  flex-direction: column-reverse;
  padding: 5px;
  border: 1px solid var(--border-color);
}

form.charsheet main section.flavor div label {
  text-align: center;
  font-size: 10px;
  margin-top: 3px;
  color: var(--text-color);
}

form.charsheet main section.flavor div textarea {
  border: 0;
  border-radius: 0;
  height: 4em;
  background-color: var(--textarea-bg-color);
}

form.charsheet main section.flavor div:first-child {
  border-radius: 10px 10px 0 0;
}

form.charsheet main section.flavor div:not(:first-child) {
  margin-top: 10px;
}

form.charsheet main section.flavor div:last-child {
  border-radius: 0 0 10px 10px;
}

form.charsheet main section.features {
  padding: 0px;
  background-color: var(--form-bg-color);
}

form.charsheet main section.features div {
  padding: 10px;
  font-weight: bold;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column-reverse;
  background-color: var(--light-cream);
}

form.charsheet main section.features div label {
  text-align: center;
  color: var(--text-color);
}

form.charsheet main section.features div textarea {
  border: 0;
  padding: 5px;
  height: 47em;
  background-color: var(--textarea-bg-color);
}

form.charsheet header section.encumberance {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 10px;
  width: 100%;
  background-color: var(--form-bg-color);
}

form.charsheet header section.encumberance > div {
  margin: 10px;
  font-weight: bold;
  display: flex;
  flex-direction: column;
}

form.charsheet header section.encumberance > div > label {
  order: 3;
  text-align: center;
  color: var(--text-color);
}

form.charsheet header section.encumberance > div > div > table {
  width: 100%;
  height: 100%;
}

form.charsheet header section.encumberance > div > div > table th, form.charsheet header section.encumberance > div > div > table td {
  font-size: 10px;
  color: var(--text-color);
}

form.charsheet header section.encumberance > div > div > table input {
  width: calc(100% - 4px);
  border: 0;
  background-color: var(--button-bg-color);
  font-size: 10px;
  padding: 3px;
}

form.charsheet header section.encumberance > div textarea {
  border: 0;
  height: 10em;
  background-color: var(--textarea-bg-color);
}

textarea {
  overflow-y: auto;
  background-color: var(--textarea-bg-color);
}

#loadlabel {
  padding: 5px;
  font-weight: bold;
  color: var(--text-color);
}
/* Hover Tooltip */
.notefield:hover::after {
  content: attr(value);
  position: absolute;
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 6px;
  border-radius: 8px;
  max-width: 200px;
  z-index: 1000;
  white-space: pre-wrap;
  font-size: 10px;
  transform: translateY(20px);
}

/* Modal Styling */
#notes-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

#notes-modal-content {
  background: var(--form-bg-color);
  padding: 20px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 0 10px black;
  display: flex;
  flex-direction: column;
}

#notes-modal-content textarea {
  width: 95%;
  height: 10em;
  margin-top: 10px;
  font-size: 14px;
}


.notefield:hover::after {
  content: attr(value);
  position: absolute;
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 6px;
  border-radius: 8px;
  max-width: 200px;
  z-index: 1000;
  white-space: pre-wrap;
  font-size: 10px;
  transform: translateY(20px);
}
