/* Settings page (php/settings/). The root also has class "blog", so it shares the blog's colours, buttons
   (.blog-btn), switches (.blog-switch), labels and the hidden-attribute fix from css/blog.css. */

.settings { --set-ease: cubic-bezier(0.1, 0.9, 0.2, 1); }

.set-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: start; }

/* ---------- Tab list ---------- */

.set-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; }
.set-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--blog-text);
    font-weight: bold;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.set-nav-link i { width: 18px; text-align: center; opacity: .8; }
.set-nav-link:hover, .set-nav-link:focus { background: var(--blog-card); color: #000; text-decoration: none; }
.set-nav-link.active { background: rgba(0, 0, 0, .62); color: var(--blog-accent); border-left-color: var(--blog-accent); }
.set-nav-link.active i { opacity: 1; }

/* ---------- Panels + cards ---------- */

.set-panel.active { animation: set-panel-in .25s var(--set-ease); }
@keyframes set-panel-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.set-panel-title { margin-bottom: 12px; }
.set-intro { color: var(--blog-muted); margin: -4px 0 12px; }

.set-card {
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 6px;
    background: var(--blog-card);
    border: 1px solid rgba(255, 255, 255, .18);
}
.set-card-title { margin: 0 0 4px; font-size: 16px; font-weight: bold; color: #1e1e1e; }
.set-card-help { margin: 0 0 12px; color: var(--blog-muted); font-size: 13px; }
.set-card .blog-label { margin-top: 0; }
.set-field { margin-bottom: 6px; max-width: 460px; }
.set-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 230px)); gap: 0 16px; }
.set-grid-2 .set-field { max-width: none; }
.set-card-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 6px; }
.set-card-actions-loose { margin-top: -2px; }
.set-save-state { margin-right: auto; }
/* Save buttons are greyed out until there's something to save (blog.css's "busy" cursor doesn't fit that) */
.settings .blog-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Profile summary + picture */
.set-profile-card { display: flex; align-items: center; gap: 16px; }
.set-avatar-wrap { position: relative; flex: 0 0 auto; cursor: pointer; border-radius: 50%; }
.set-avatar { flex: 0 0 72px; width: 72px; height: 72px; font-size: 30px; }
.set-avatar-edit {
    position: absolute; inset: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .55); color: #fff; font-size: 20px;
    opacity: 0; transition: opacity .15s ease;
}
.set-avatar-wrap:hover .set-avatar-edit, .set-avatar-wrap:focus .set-avatar-edit { opacity: 1; }
.set-uploading .set-avatar-edit { opacity: 1; }
.set-uploading .set-avatar-edit i::before { content: "\f110"; } /* spinner */
.set-uploading .set-avatar-edit i { animation: fa-spin 1s linear infinite; }
.set-avatar-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Delete account */
.set-card-danger { border-color: #ff505066; }
.set-card-danger .set-card-title { color: #8a1c1c; }
.set-card-help-last { margin-bottom: 0; }
.set-check { display: flex; align-items: center; gap: 8px; font-weight: normal; margin: 0 0 12px; cursor: pointer; }
.set-check input { margin: 0; }
.set-profile-name { font-size: 22px; font-weight: bold; font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif; color: #1e1e1e; }

/* ---------- Preference rows (drawn from php/prefs.php) ---------- */

.set-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--blog-line);
}
.set-card-title + .set-row { border-top: 0; padding-top: 6px; }
.set-row-text { min-width: 0; }
.set-row-label { display: block; margin: 0; font-weight: bold; color: #1e1e1e; }
.set-row-help { display: block; color: var(--blog-muted); font-size: 12px; margin-top: 2px; }
.set-row-control { flex: 0 0 auto; }

/* Option buttons (type "choice") */
.set-seg { display: inline-flex; border-radius: 6px; background: var(--blog-dark); border: 1px solid #6b707a; padding: 2px; }
.set-seg-opt { margin: 0; font-weight: normal; cursor: pointer; }
.set-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.set-seg-opt span {
    display: block; padding: 5px 14px; border-radius: 4px; color: #9fa6b3;
    transition: background-color .15s ease, color .15s ease;
}
.set-seg-opt:hover span { color: #fff; }
.set-seg-opt input:checked + span { background: #007082; color: #fff; }
.set-seg-opt input:focus-visible + span { box-shadow: 0 0 0 2px var(--blog-accent); }

/* Sliders (types "range" and "hue") */
.set-range { display: flex; align-items: center; gap: 10px; }
.set-range input[type=range] { width: 200px; accent-color: #007082; cursor: pointer; }
.set-range-value {
    min-width: 30px; text-align: center; font-weight: bold;
    padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .62); color: var(--blog-accent);
}
.set-range-hue input[type=range] {
    -webkit-appearance: none; appearance: none;
    height: 12px; border-radius: 999px;
    background: linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(359 100% 50%));
}
.set-range-hue input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #202021;
}
.set-range-hue input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #202021; }
.set-swatch { width: 26px; height: 26px; border-radius: 50%; background: hsl(var(--hue, 195) 100% 50%); border: 2px solid #202021; }

/* ---------- Sessions ---------- */

.set-devices { list-style: none; margin: 0 0 6px; padding: 0; }
.set-device { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--blog-line); }
.set-device:first-child { border-top: 0; }
.set-device > i { width: 18px; text-align: center; color: var(--blog-muted); }
.set-device-name { font-weight: bold; }
.set-device-when { margin-left: auto; color: var(--blog-muted); font-size: 12px; }
.set-device-this > i { color: #007082; }

/* ---------- Small screens: tabs become a row across the top ---------- */

@media (max-width: 760px) {
    .set-layout { grid-template-columns: 1fr; gap: 14px; }
    .set-nav { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 4px; }
    .set-nav-link {
        flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; text-align: center;
        border-left: 0; border-bottom: 3px solid transparent;
    }
    .set-nav-link i { font-size: 16px; }
    .set-nav-link.active { border-bottom-color: var(--blog-accent); }
    .set-grid-2 { grid-template-columns: 1fr; }
    .set-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .set-range input[type=range] { width: 100%; }
    .set-range { width: 100%; }
    .set-row-control { width: 100%; }
    .set-device-when { margin-left: 28px; flex-basis: 100%; }
}
