/* card-based layout for the settings page; loaded after settings.css so the theme variables still apply */

html, body { height: auto; min-height: 100%; }
body { overflow-x: hidden; }

#content-side {
    justify-content: flex-start;
    align-items: center;
    padding: 20px 16px 60px;
    box-sizing: border-box;
}

.top {
    width: min(720px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.back {
    position: absolute;
    left: 0;
    top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--border-color2) 70%, transparent);
    background: color-mix(in srgb, var(--background-color) 65%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-decoration: none;
    font-size: 17px;
    animation: none;
    transition: background .18s, transform .18s;
}
.back:hover { background: var(--hover-color); transform: translateX(-2px); }

h1 { font-size: 64px; margin: 34px 0 14px; }

.jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.jump a {
    text-decoration: none;
    font-size: 15px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--border-color2) 60%, transparent);
    background: color-mix(in srgb, var(--background-color) 55%, transparent);
    animation: none;
    transition: background .18s, border-color .18s;
}
.jump a:hover { background: var(--hover-color); border-color: var(--border-color2); }
html { scroll-behavior: smooth; }
.card { scroll-margin-top: 16px; }

.cards {
    width: min(720px, 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    text-align: left;
    padding: 20px 22px 22px;
    border-radius: 24px;
    border: 1.5px solid color-mix(in srgb, var(--border-color2) 55%, transparent);
    background: color-mix(in srgb, var(--background-color) 72%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.card h2 { margin: 0 0 4px; font-size: 26px; animation: none; }
.card h3 { margin: 4px 0 10px; font-size: 20px; }
.hint {
    margin: 0 0 14px;
    padding: 0;
    text-align: left;
    font-size: 16px;
    line-height: 1.4;
    opacity: .78;
    animation: none;
}

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.stack { flex-direction: column; align-items: stretch; }
.row.stack > * { width: 100% !important; max-width: none !important; box-sizing: border-box; }

.card select, .card input[type="text"], .card input[type="url"] {
    flex: 1 1 220px;
    width: auto;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    padding: 10px 16px;
    font-size: 18px;
    text-align: left;
    border: 1.5px solid color-mix(in srgb, var(--border-color2) 75%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--background-color) 80%, transparent);
    color: var(--text-color);
    font-family: var(--font-family);
    animation: none;
    transition: border-color .18s, box-shadow .18s;
}
.card select:focus, .card input:focus { outline: none; border-color: var(--border-color2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--border-color2) 28%, transparent); }
.card input::placeholder { color: var(--text-color); opacity: .55; }
#panicKey { cursor: pointer; text-align: center; }
#panicKey:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--border-color2) 45%, transparent); }

/* buttons */
.card button {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 10px 20px;
    font-size: 17px;
    border-radius: 14px;
    border: 1.5px solid color-mix(in srgb, var(--border-color2) 80%, transparent);
    background: color-mix(in srgb, var(--background-color) 80%, transparent);
    color: var(--text-color);
    cursor: pointer;
    animation: none;
    transition: background .18s, color .18s, transform .18s, border-color .18s;
}
.card button:hover { transform: translateY(-1px); background: var(--hover-color); }
.card button.primary { background: var(--text-color); color: var(--background-color); border-color: var(--text-color); }
.card button.primary:hover { filter: brightness(1.12); background: var(--text-color); }
.card button.danger { border-color: #e5484d; color: #ff8a8e; }
.card button.danger:hover { background: #e5484d; color: #fff; }

/* custom theme editor */
#custom-theme-settings {
    width: 100%;
    max-width: none;
    margin: 16px 0 0;
    padding: 16px 16px 18px;
    box-sizing: border-box;
    border-radius: 18px;
    border: 1.5px dashed color-mix(in srgb, var(--border-color2) 55%, transparent);
    background: color-mix(in srgb, var(--background-color) 55%, transparent);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}
.theme-property {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    margin: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color2) 22%, transparent);
}
#custom-theme-settings label { font-size: 17px; padding: 0; text-align: left; }
#custom-theme-settings input[type="text"] { flex: 1 1 200px; max-width: 320px; }
#custom-theme-settings input[type="color"] {
    width: 48px;
    height: 34px;
    padding: 2px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}
#custom-theme-settings .row { margin-top: 14px; justify-content: flex-end; }

/* status messages */
.note {
    display: inline-block;
    margin: 12px 0 0;
    padding: 8px 14px;
    font-size: 15px;
    text-align: left;
    border-radius: 10px;
    background: color-mix(in srgb, #2bb673 28%, var(--background-color));
    border: 1px solid #2bb673;
    animation: none;
}

/* link behaviour as a two-way switch */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--border-color2) 70%, transparent); }
.seg label { cursor: pointer; font-size: 17px; }
.seg input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 22px; border-radius: 10px; transition: background .18s, color .18s; }
.seg input:checked + span { background: var(--text-color); color: var(--background-color); }
.seg input:focus-visible + span { outline: 2px solid var(--border-color2); outline-offset: 2px; }

@media (max-width: 560px) {
    h1 { font-size: 48px; }
    .back { position: static; align-self: flex-start; margin-bottom: 4px; }
    .card { padding: 16px 16px 18px; border-radius: 20px; }
    .theme-property { flex-direction: column; align-items: stretch; }
    #custom-theme-settings input[type="text"] { max-width: none; }
}

.row.stack > * { flex: 0 0 auto !important; }

/* text on the switch is an image drawn in the text colour, so mark the selection with a ring instead of a fill */
.seg input:checked + span {
    background: color-mix(in srgb, var(--text-color) 22%, transparent);
    color: var(--text-color);
    box-shadow: inset 0 0 0 1.5px var(--text-color);
}
