/* SPDX-License-Identifier: AGPL-3.0-only
 * SPDX-FileCopyrightText: 2021-2026 DALICC - Verein zur Foerderung der Rechtssicherheit in der Datenbewirtschaftung (ZVR 1249185710)
 */
/* DALICC "My licenses": the list of a person's own licenses and the manage page of
 * one of them. Loaded after site.css, components.css and auth.css, which already
 * carry the buttons, badges, tables, panels and form controls used here.
 *
 * Only three things are new: the tab strip over the two lists, the panel grid of the
 * manage page, and the version timeline.
 */

/* ------------------------------------------------------------------ toolbar */

.my-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
}

.my-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.my-tab {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--c-rule-strong);
  border-bottom-width: 3px;
  background: var(--c-surface);
  color: var(--c-slate);
  font-family: var(--font-display);
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.9em;
}

.my-tab:hover,
.my-tab:focus-visible {
  background: var(--c-surface-alt);
  text-decoration: none;
}

.my-tab--current {
  border-bottom-color: var(--c-red);
  color: var(--c-ink);
}

/* -------------------------------------------------------------------- table */

.my-table {
  width: 100%;
}

.my-table td,
.my-table th {
  vertical-align: top;
}

.my-table time {
  white-space: nowrap;
}

/* --------------------------------------------------------------- manage page */

.my-head h1 {
  margin-bottom: 8px;
}

.my-head .badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.my-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.my-panel {
  padding: 20px 24px;
  border: 1px solid var(--c-rule-strong);
  background: var(--c-surface);
  margin: 0 0 24px;
}

.my-panel h2 {
  margin-top: 0;
}

.my-panel .account-facts {
  margin-bottom: 0;
}

.my-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.my-actions .inline-form {
  margin: 0;
}

/* ----------------------------------------------------------------- timeline */

.my-timeline {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  border-left: 3px solid var(--c-rule-strong);
}

.my-timeline__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0 8px 16px;
  position: relative;
}

.my-timeline__item--current {
  border-left: 3px solid var(--c-green);
  margin-left: -3px;
}

.my-timeline__version {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--c-slate);
}

.my-timeline__id code {
  font-size: 0.85em;
  word-break: break-all;
}

/* --------------------------------------------------------------------- forms */

.member-form,
.stacked-form {
  margin-top: 20px;
  max-width: 520px;
}

.member-form .field,
.stacked-form .field {
  margin-bottom: 16px;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 604px) {
  .my-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .my-panel {
    padding: 16px;
  }

  .my-actions .btn {
    width: 100%;
    text-align: center;
  }

  .my-actions .inline-form {
    width: 100%;
  }

  .my-actions .inline-form .btn {
    width: 100%;
  }
}

/* ------------------------------------- inline actions on the admin list page */

.admin-inline {
  display: inline-block;
  margin: 4px 0;
}

.admin-inline > summary {
  cursor: pointer;
  list-style: none;
}

.admin-inline > summary::-webkit-details-marker {
  display: none;
}

.admin-inline__body {
  min-width: 240px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--c-rule-strong);
  background: var(--c-surface-alt);
}

.admin-inline__body .stacked-form {
  margin-top: 0;
}

.admin-inline__body .stacked-form + .stacked-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--c-rule);
}

/* ------------------------------------- the paragraphs above the composer's form */

.composer-account,
.composer-callout {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 4px solid var(--c-green);
  background: var(--c-surface-alt);
  color: var(--c-ink-soft);
}

.composer-account .btn {
  margin-top: 4px;
}

/* ------------------------------------------- owner box on a public license page */

.owner-box {
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px solid var(--c-rule-strong);
  background: var(--c-surface-alt);
}

.owner-box__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--c-slate);
}

.owner-box__facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 8px;
}

.owner-box__facts dt {
  color: var(--c-slate-muted);
}

.owner-box__facts dd {
  margin: 0;
}

.owner-box__note {
  margin: 0;
  font-size: 0.9em;
  color: var(--c-slate-muted);
}

.license-version {
  margin: 4px 0 0;
  color: var(--c-slate);
}
