/* base64.pi7.org tool styles. Rides on top of common.css (shared Pi7 theme).
   Palette comes from common.css: --pcolor #4449a6, --scolor #d31b5a, --muted #5b6b7a */

/* ---------- file picker (encoder pages) ---------- */
.box {
  display: flex;
  justify-content: center;
}

.imagelabel {
  width: 70%;
  margin: 20px 0;
  border: 3px dashed #9da0d9;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 142px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s;
}

.imagelabel:hover {
  border: 3px solid #9da0d9;
}

.imagelabel i {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  padding: 0 10px;
  text-align: center;
}

.imagelabel b {
  padding: 9px 16px;
  border-radius: 2px;
  color: #fff;
  background: var(--pcolor);
  margin-top: 10px;
  font-size: 14px;
}

.result {
  display: flex;
  flex-flow: column;
  align-items: center;
}

.result img {
  height: 70px;
  width: auto;
}

.result span,
.result pre {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  word-break: break-all;
}

/* ---------- code output blocks ---------- */
#code-con > div {
  background: #eff0fa;
  padding: 12px;
  border-radius: 2px;
  border: 1px solid #e2e4f3;
}

#code-con h3 {
  margin: 18px 0 4px;
  color: var(--pcolor);
}

.code-cp {
  height: 70px;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-all;
  outline: none;
  margin-top: 10px;
  background: #fff;
  padding: 10px;
  border: 1px solid #e2e4f3;
  border-radius: 2px;
  color: #505050;
  font-size: 14px;
}

.buttonsp > span,
.divbuttons > span {
  background: var(--pcolor);
  color: #fff;
  padding: 6px 12px;
  margin: 0 5px;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  display: inline-block;
}

.buttonsp > span:hover,
.divbuttons > span:hover {
  background: #363b8c;
}

/* ---------- decoder pages (textarea in, file out) ---------- */
.b64img {
  margin-top: 30px;
}

.b64img textarea,
.normaldiv textarea,
.basediv textarea {
  display: block;
  outline: none;
  width: 80%;
  padding: 10px 15px;
  border: 3px dashed #9da0d9;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: sans-serif;
  font-size: 14px;
  resize: vertical;
}

.b64img textarea:hover,
.normaldiv textarea:hover,
.basediv textarea:hover {
  border: 3px solid #9da0d9;
}

textarea:focus {
  border: 3px solid var(--pcolor) !important;
}

.compressbtn {
  padding: 9px 16px;
  min-width: 120px;
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: var(--pcolor);
  margin-top: 20px;
  border-radius: 2px;
  font-size: 14px;
}

.compressbtn:hover {
  background: #363b8c;
}

.odwnbtn {
  background: #047e73;
  color: #fff;
  cursor: pointer;
  padding: 9px 16px;
  min-width: 120px;
  display: inline-block;
  border: none;
  font-weight: 700;
  margin-top: 20px;
  border-radius: 2px;
  font-size: 14px;
}

.odwnbtn:hover {
  background: #036459;
}

#docsrc {
  max-width: 70%;
  max-height: 400px;
}

.output {
  margin-top: 24px;
}

/* ---------- text encoder (two-pane) ---------- */
.container_in {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.normaldiv,
.basediv {
  display: flex;
  width: 44%;
  flex-direction: column;
}

.normaldiv textarea,
.basediv textarea {
  width: 100%;
}

/* label on the left, action buttons on the right, both panes the same height
   so the two textareas line up */
.paneheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  gap: 8px;
  flex-wrap: wrap;
}

.divbuttons {
  display: flex;
  gap: 6px;
}

.normaldiv label,
.basediv label {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- decoder notes (what got auto-repaired, or why it failed) ------- */
.decnote {
  font-size: 14px;
  line-height: 1.5;
  margin: 14px auto 0;
  max-width: 90%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 4px;
}

.decnote:empty {
  display: none;
}

.decfix {
  background: #eef6ee;
  border-left: 3px solid #2c782e;
  color: #29542a;
}

.decerr {
  background: #fdefef;
  border-left: 3px solid #d31b5a;
  color: #8c1338;
}

.decerr a {
  color: #8c1338;
  text-decoration: underline;
}

/* ---------- SVG converter output ---------- */
.svgprev {
  padding: 18px;
  background: #fff;
  border: 1px solid #e2e4f3;
  border-radius: 4px;
  margin: 18px auto 0;
  max-width: 90%;
}

.svgprev img {
  max-width: 240px;
  max-height: 180px;
  height: auto;
}

.svgblock {
  background: #eff0fa;
  padding: 12px;
  border-radius: 2px;
  border: 1px solid #e2e4f3;
  margin: 0 auto 14px;
  max-width: 90%;
}

#svgout h3,
#valout h3 {
  margin: 18px 0 4px;
  color: var(--pcolor);
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* ---------- validator report ---------- */
.valtable {
  width: 90%;
  margin: 14px auto 0;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.valtable td {
  border-bottom: 1px solid #e2e4f3;
  padding: 9px 10px;
  vertical-align: top;
}

.valtable .vmark {
  font-weight: 700;
  font-size: 12px;
  width: 58px;
  white-space: nowrap;
}

.vok .vmark {
  color: #2c782e;
}

.vbad .vmark {
  color: #d31b5a;
}

.vinfo .vmark {
  color: var(--muted);
}

.vbad {
  background: #fdefef;
}

/* ---------- article + FAQ ---------- */
.articlesec ol li,
.articlesec ul li {
  list-style-position: outside;
  margin-left: 18px;
  margin-top: 10px;
}

.articlesec code {
  background: #eff0fa;
  border: 1px solid #e2e4f3;
  border-radius: 2px;
  padding: 1px 5px;
  font-size: 13px;
  word-break: break-all;
}

.faqdiv {
  padding: 2vw 0 0;
}

.faqdiv h3 {
  margin-bottom: 4px;
}

.ansdiv {
  border-left: 2px solid #d8dbf0;
  margin-left: 6px;
  padding-left: 14px;
}

.ansdiv p {
  margin-top: 4px;
}

/* .centp centers the tool chrome (buttons, preview images) but prose and
   headings stay left-aligned to match the other Pi7 tools. */
.centp {
  text-align: center;
}

.centp p,
.centp li,
.articlesec h2,
.articlesec h3 {
  text-align: left;
}

/* ---------- misc ---------- */
/* common.css sets .spinneroverlay to display:flex. The tool JS toggles it with
   an inline style, so the resting state has to be none (and must not use
   !important, or the inline style could never win). */
.spinneroverlay {
  display: none;
}

.footcre a {
  margin-left: 5px;
}

.heartbt {
  animation: beat .5s infinite alternate;
  transform-origin: center;
  display: inline-block;
  padding: 0 5px;
}

@keyframes beat {
  to {
    transform: scale(1.8);
  }
}

@media only screen and (max-width: 900px) {
  .imagelabel,
  .b64img textarea {
    width: 90%;
  }

  .normaldiv,
  .basediv {
    width: 100%;
  }

  #docsrc {
    max-width: 95%;
  }

  .articlesec code {
    font-size: 12px;
  }
}
