/* algofoto: one stylesheet for the frame, the owner page and the message pages. Kept simple for old tablets. */
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: #2b3a1f; background: #eef4e8; }
h1 { color: #2f6a1e; font-size: 1.6em; margin: 0 0 0.6em; }
h2 { color: #2f6a1e; font-size: 1.2em; margin: 1.6em 0 0.6em; }
a { color: #2f6a1e; }
button, select, input { font: inherit; }
.button, button {
  background: #2f7d5b; color: #fff; border: 0; border-radius: 6px; padding: 0.55em 1.1em; cursor: pointer;
}
.button:hover, button:hover { background: #245f45; }
button.quiet { background: #d8e4cf; color: #2b3a1f; }
button.danger { background: #b23b2e; }

/* ---- the language switch (top right of every page; in the frame's controls) ---- */
p.lang { float: right; margin: 0 0 0.5em 1em; font-size: 0.9em; }
#controls a.button-like {
  display: inline-block; background: rgba(255, 255, 255, 0.85); color: #222; text-decoration: none;
  border-radius: 22px; padding: 0.5em 0.9em; margin: 0 4px 6px; font-size: 16px;
}

/* ---- message pages (link invalid, frame moved, ...) ---- */
body.message { background: #9dc67c; }
body.message main {
  max-width: 34em; margin: 12vh auto 0; padding: 1.5em 1.6em; background: #fff; border-radius: 10px;
  box-sizing: border-box; width: calc(100% - 32px);
}
body.message p { line-height: 1.5; margin: 0; }

/* ---- the frame ---- */
body.frame { background: #000; color: #fff; overflow: hidden; height: 100%; }
html.frame-page { height: 100%; background: #000; }
.slide {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #000; background-repeat: no-repeat; background-position: center center;
  -webkit-background-size: contain; background-size: contain;
  opacity: 0; -webkit-transition: opacity 1s ease; transition: opacity 1s ease;
}
.slide.on { opacity: 1; }
.video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: #000;
}
.video.off { display: none; }
#caption {
  position: absolute; left: 18px; bottom: 14px; z-index: 2; font-size: 15px; line-height: 1.35;
  color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; opacity: 0.85; max-width: 70%;
}
#caption.empty { display: none; }
#caption .title { font-size: 20px; font-weight: bold; margin-bottom: 2px; }
#notice {
  position: absolute; left: 50%; top: 40%; z-index: 4; width: 80%; max-width: 30em; margin-left: -40%;
  background: rgba(255, 255, 255, 0.92); color: #2b3a1f; padding: 1em 1.2em; border-radius: 10px;
  font-size: 18px; line-height: 1.4; text-align: center; box-sizing: border-box;
}
@media (min-width: 750px) { #notice { margin-left: -15em; } }
#notice.off { display: none; }
#controls {
  position: absolute; left: 0; right: 0; bottom: 18px; z-index: 3; text-align: center; display: none;
}
#controls.show { display: block; }
#controls button, #controls select {
  background: rgba(255, 255, 255, 0.85); color: #222; border: 0; border-radius: 22px;
  padding: 0.5em 0.9em; margin: 0 4px 6px; font-size: 16px;
}

/* ---- the owner page ---- */
body.owner main { max-width: 60em; margin: 0 auto; padding: 1.2em 16px 3em; }
.counts { margin: 0 0 0.5em; }
.row { margin: 0.4em 0; }
.row label { display: inline-block; min-width: 4.5em; }
.row input[type=text], .row select {
  padding: 0.45em 0.6em; border: 1px solid #b9c9ad; border-radius: 6px; background: #fff; max-width: 100%;
}
#newlink { margin: 1em 0; padding: 1em; background: #fff; border-radius: 8px; border: 1px solid #b9c9ad; }
#newlink.off { display: none; }
#newlink input { width: 100%; box-sizing: border-box; padding: 0.5em; font-family: Consolas, monospace; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; border-radius: 8px; }
th, td { text-align: left; padding: 0.5em 0.6em; border-bottom: 1px solid #e1e9da; vertical-align: top; }
th { font-weight: normal; color: #5b6b4f; font-size: 0.9em; }
tr.cancelled td { color: #9aa58f; }
.small { font-size: 0.85em; color: #5b6b4f; }

/* ---- the owner's photo grid ---- */
.tabs { margin: 0.4em 0 0.6em; }
.tab { background: #d8e4cf; color: #2b3a1f; margin: 0 0.4em 0.4em 0; }
.tab.on { background: #2f7d5b; color: #fff; }
.grid { display: flex; flex-wrap: wrap; margin: 0 -5px; }
.tile {
  position: relative; width: 150px; margin: 5px; background: #fff; border: 1px solid #d6e2cc; border-radius: 8px;
  overflow: hidden;
}
.tile img, .tile .placeholder { display: block; width: 150px; height: 150px; object-fit: cover; background: #e4ecdc; }
.tile .placeholder { line-height: 150px; text-align: center; color: #5b6b4f; font-size: 0.9em; }
.tile .badge {
  position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.75em;
  padding: 0.15em 0.5em; border-radius: 10px;
}
.tile .title { font-size: 0.85em; font-weight: bold; padding: 0.35em 0.5em 0; word-break: break-word; }
.tile .title + .meta { padding-top: 0.1em; }
.tile .meta { font-size: 0.78em; color: #5b6b4f; padding: 0.35em 0.5em 0; word-break: break-word; }
.tile .actions { padding: 0.35em 0.4em 0.5em; }
.tile .actions button { font-size: 0.8em; padding: 0.35em 0.6em; margin: 0.15em 0.1em; }
@media (max-width: 420px) {
  .tile { width: calc(50% - 10px); }
  .tile img, .tile .placeholder { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* ---- the sending page ---- */
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.button.big { display: inline-block; font-size: 1.15em; padding: 0.8em 1.4em; }
.hidden-input:focus + .button { outline: 3px solid #9dc67c; }
.uploads { list-style: none; margin: 1em 0; padding: 0; }
.uploads li {
  background: #fff; border: 1px solid #d6e2cc; border-radius: 8px; padding: 0.6em 0.8em; margin-bottom: 0.5em;
}
.uploads .name { font-size: 0.95em; word-break: break-all; }
.uploads .bar { height: 6px; background: #e4ecdc; border-radius: 3px; margin: 0.45em 0; overflow: hidden; }
.uploads .bar div { height: 100%; width: 0; background: #2f7d5b; }
.uploads .status { font-size: 0.9em; color: #5b6b4f; }
.uploads li.done .status { color: #2f6a1e; }
.uploads li.failed .status { color: #b23b2e; }
.uploads li.failed .bar div { background: #b23b2e; }
.links a { margin-right: 1.2em; }
.off { display: none; }
.error { color: #b23b2e; }
