/* Central stylesheet for Cache Tools */


:root {
  --bg: white;
  --text: black;
  --header-width--touch: 150px;
  --header-width--mouse: 250px;

  --box-bg: #f3f3f3;
  --card-bg: white;
  --hint: #555;
  --input-bg: #fff;
  --primary: #72a807;
  --result-border: #d9d9d9;
  --result-ok: #72a807;
  --result-idle: #8e8e8e;
  --result-error: #c03a2b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: white;

    --box-bg: #262626;
    --card-bg: #3a3a3a;
    --hint: #aaa;
    --input-bg: #9f9f9f;

    --primary: #8ed402;
    --result-border: #4a4a4a;
    --result-ok: #8ed402;
    --result-idle: #9f9f9f;
    --result-error: #ff7b6b;
  }
}

html {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, Arial, sans-serif;
  padding: 20px;
  max-width: 1024px;
  margin: auto;

}

.lang {

  .de,
  .en {
    color: inherit;
    text-decoration: none;
  }

  a.is-active {
    color: var(--primary);
    text-decoration: underline;
  }

  a:hover,
  a:focus,
  a:active {
    color: var(--primary);
    text-decoration: underline;
  }
}

main {
  background-color: var(--box-bg);
  margin-top: 30px;
  padding: 20px;
  border-radius: 10px;
}

.hint {
  color: var(--hint);
  margin-top: 12px;
  font-size: 0.95rem;
}

label {
  display: block;
  width: 80px;
  margin-top: 8px;
  margin-bottom: 8px;
  margin-right: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.field label {
  white-space: nowrap;
}

input[type="text"],
input[type="password"] {
  box-sizing: border-box;
  border-radius: 10px;
  border: none;
  outline: none;
  width: 100%;
  padding: 14px 20px;
  margin-top: 0;
  background-color: var(--input-bg);
}

@media (min-width: 540px) {
  .field {
    flex-direction: row;
    align-items: center;
  }

  .field input {
    flex: 1;
  }
}

.btn {
  display: inline-block;
  border: none;
  outline: none;
  background-color: var(--primary);
  color: white;
  padding: 8px 16px;
  margin-top: 12px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}

.btn--secondary {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--result-border);
  margin-left: 8px;
}

.results-view {
  display: grid;
  gap: 16px;
}

.results-grid {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  background: var(--card-bg);
  border-left: 6px solid var(--result-border);
  border-radius: 10px;
  padding: 16px;
}

.result-card.is-ok {
  border-left-color: var(--result-ok);
}

.result-card.is-idle {
  border-left-color: var(--result-idle);
}

.result-card.is-error {
  border-left-color: var(--result-error);
}

.result-url,
.result-meta p {
  margin: 0;
}

.result-url span {
  color: var(--primary);
}

.result-url {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  margin: 0;
  border-bottom: 1px solid var(--result-border);
}

.result-meta {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  margin: 0;
}
.result-url strong,
.result-meta strong {
  width: 80px;
}
.result-meta div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.result-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 2px 20px;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  background: var(--result-border);
}

.result-state.is-ok {
  background: var(--result-ok);
}

.result-state.is-idle {
  background: var(--result-idle);
}

.result-state.is-error {
  background: var(--result-error);
}

.result-card strong {
  display: inline-block;
  margin-bottom: 4px;
}

footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.space {
  margin-top: 24px;
  margin-bottom: 12px;
}

footer a {
  color: inherit;
  text-decoration: underline
}

footer a.no-underline {
  text-decoration: none
}

.muted {
  opacity: 0.6
}

.logo img {
  filter: brightness(0.35);
}

@media (prefers-color-scheme: dark) {
  .logo img {
    filter: none;
  }
}


/* mobile */
@media (pointer: coarse) {
  .header {
    display: grid;
  }

  .title {
    justify-self: center;
  }

  .logo {
    margin-left: auto;

    img {
      width: var(--header-width--touch);
    }
  }
}

/* desktop */
@media (pointer: fine) {
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .title {
    order: 1;
  }

  .logo {
    order: 2;

    img {
      width: var(--header-width--mouse);
    }
  }
}