@import url("appearance-tokens.css");

.profile-appearance {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
    width: 100%;
    max-width: 672px;
    padding: 1.5rem;
    box-sizing: border-box;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.profile-appearance__head {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
}

.profile-appearance__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--preview-weight);
    font-size: 24px;
    line-height: 32px;
    color: var(--text);
}

.profile-appearance__lead {
    margin: 0;
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: var(--muted);
}

.appearance-banner {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 14px;
}

.appearance-banner__icon {
    flex: none;
    width: 22px;
    height: 22px;
    background-color: var(--accent);
    -webkit-mask: url("../icons/personality-icon.svg") center / contain no-repeat;
    mask: url("../icons/personality-icon.svg") center / contain no-repeat;
}

.appearance-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.appearance-banner__title {
    margin: 0;
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--text);
}

.appearance-banner__hint {
    margin: 0;
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    color: var(--muted);
}

.appearance-toggle {
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: none;
    width: 44px;
    height: 26px;
    padding: 0 0.1875rem;
    border: 0;
    border-radius: 13px;
    background: var(--accent);
    cursor: pointer;
}

.appearance-toggle[aria-checked="false"] {
    justify-content: flex-start;
    background: var(--border);
}

.appearance-toggle__knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--on-accent);
}

.appearance-themes {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
}

.appearance-themes__title {
    margin: 0;
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--text);
}

.appearance-themes__h {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.appearance-themes__meta {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 19px;
    color: var(--muted);
}

.appearance-themes__reset {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 19px;
    color: var(--muted);
}

.appearance-themes__reset:hover {
    color: var(--text);
}

.appearance-themes__reset[hidden] {
    display: none;
}

.appearance-themes__description {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    color: var(--muted);
}

.appearance-presets {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.875rem;
    width: 100%;
    padding-top: 0.5rem;
}

.appearance-preset {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.appearance-preset.is-selected {
    border: 1px solid var(--accent);
}

.appearance-preset__prev {
    position: relative;
    height: 120px;
    overflow: hidden;
    background: var(--bg);
}

.appearance-preset__ag {
    position: absolute;
    left: 16px;
    top: 16px;
    font-family: var(--font-display);
    font-weight: var(--preview-weight);
    font-size: 34px;
    line-height: 40px;
    color: var(--text);
}

.appearance-preset__bar {
    position: absolute;
    left: 16px;
    top: 70px;
    width: 70px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.22);
}

.appearance-preset__chip {
    position: absolute;
    left: 16px;
    top: 88px;
    width: 56px;
    height: 16px;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: var(--accent-shadow);
}

.appearance-preset__foot {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    padding: 0.75rem 0.875rem;
    background: var(--panel);
}

.appearance-preset__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
}

.appearance-preset__name {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 18px;
    color: var(--text);
}

.appearance-preset__trait {
    margin-left: auto;
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 15px;
    color: var(--accent);
}

.appearance-preset__font {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 15px;
    color: var(--muted);
}

.appearance-presets.is-locked .appearance-preset {
    cursor: not-allowed;
}

.appearance-preset:not(:disabled) {
    cursor: pointer;
}

.profile-card {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
}

.profile-input {
    background: var(--bg) !important;
    color: var(--text);
    border: 1px solid var(--border);
}

.profile-input:invalid {
    font-weight: 400;
    color: var(--muted);
}

.profile-label,
.profile-page-wrapper label {
    color: var(--text);
}

.profile-muted {
    color: var(--muted);
}

.profile-btn-accent {
    background: var(--accent);
    color: var(--on-accent);
    border: 0;
}

.profile-btn-accent:hover {
    filter: brightness(1.06);
}

.profile-btn-outline {
    background: color-mix(in srgb, var(--panel) 85%, white 6%);
    color: var(--text);
}

.profile-btn-outline:hover,
.profile-token-toggle:hover,
.profile-btn-export:hover {
    background: var(--border);
}

.profile-btn-export,
.profile-token-toggle {
    background: var(--bg);
    color: var(--text);
}

.profile-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.profile-icon--json {
    -webkit-mask-image: url("../icons/export-json.svg");
    mask-image: url("../icons/export-json.svg");
}

.profile-icon--pdf {
    -webkit-mask-image: url("../icons/export-pdf.svg");
    mask-image: url("../icons/export-pdf.svg");
}

.profile-icon--logout {
    -webkit-mask-image: url("../icons/logout.svg");
    mask-image: url("../icons/logout.svg");
}

.profile-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 672px;
    margin-top: 1rem;
    padding: 10px 16px;
    box-sizing: border-box;
    border: none;
    border-radius: 14px;
    background: #ef4444;
    color: #fff;
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.profile-btn-logout:hover {
    background: #dc2626;
    color: #fff;
}

.profile-badge {
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    border-color: var(--accent) !important;
    color: var(--text);
}

.profile-badge.is-locked {
    background: color-mix(in srgb, var(--panel) 55%, transparent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.profile-badge__title {
    color: var(--text);
}

.profile-badge__title.is-muted,
.profile-badge__status {
    color: var(--muted);
}

.appearance-fonts {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    padding-top: 8px;
}

.appearance-font {
    box-sizing: border-box;
    gap: 1.25rem;
    width: 100%;
    min-height: 68px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: .75rem;

    display: grid;
    grid-template-columns: 10.625rem 18px 1fr auto;
    align-items: center;
    column-gap: 1.25rem;
}

.appearance-font__chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: none;
    width: 7.8125rem;
    min-width: 7.8125rem;
    padding-right: 8px;
}

.appearance-font__dot {
    flex: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: var(--accent-shadow);
}

.appearance-font__cn {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.appearance-font__trait {
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 15px;
    color: var(--muted);
}

.appearance-font__arrow {
    display: block;
    width: 12px;
    height: 11px;
    background-color: var(--muted);
    -webkit-mask: url("../icons/appearance-font-arrow.svg") center / contain no-repeat;
    mask: url("../icons/appearance-font-arrow.svg") center / contain no-repeat;
}

.appearance-font__sample {
    font-family: var(--font-display);
    font-weight: var(--preview-weight);
    font-size: 22px;
    line-height: 30px;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.appearance-font__fl {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex: none;
}

.appearance-font__name {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 18px;
    color: var(--accent);
}


@media (max-width: 768px) {
    .appearance-font {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "chip fl"
            "sample sample";
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.5rem;
        min-height: 0;
        padding: 0.75rem 1rem;
    }

    .appearance-font__chip {
        grid-area: chip;
        width: auto;
        min-width: 0;
        padding-right: 0;
    }

    .appearance-font__arrow {
        display: none;
    }

    .appearance-font__sample {
        grid-area: sample;
        font-size: 18px;
        line-height: 24px;
        min-width: 0;
    }

    .appearance-font__fl {
        grid-area: fl;
        align-self: start;
    }
}